that wont work just by itself...Hmm you want a popup You should use djui_popup_create("Welcome", 2)
Or you can use djui_chat_message_create("Welcome") if you want i am new so i hope this helps
sorry for taking long, but if you use a hook function for whenever a player connects (HOOK_ON_PLAYER_CONNECTED or HOOK_JOINED_GAME) then do a "djui_popup_create("message here", duration here in numbered seconds)"i'm trying to make a welcome message popup in chat
Don't double post! Use that edit button! Post automatically merged:
hello?
--only for that specific persons screen
function join_msg_local()
djui_popup_create("Hi there!", 2)
end
hook_event(HOOK_JOINED_GAME, 2)
--for everyones screen
function join_msg_global()
djui_popup_create("Hi there!", 2)
end
hook_event(HOOK_ON_PLAYER_CONNECTED, 2)
-- Functions is always important
---@param m MarioState The Mario
function welcome_msg(m)
-- we only want show for local player in screen (yes YOURSELF in screen)
if m.playerIndex ~= 0 then return end
-- if message is not equal to true we make it to true (stops it from spam)
if welcomemsg ~= true then
welcomemsg = true
djui_popup_create("Welcome!", 2) -- creates a popup the "" is the text the, 2 is seconds to disappear raise it to make longer (duration)
end -- closes if then
end -- closes the function
-- dont use incorrect hooks go to official sm64coopdx lua guide and hooks to see all hooks
-- HOOK_ON_PLAYER_CONNECTED is the correct hook it is called every time when a player joins the server (Called when a player connects) HOOK_JOINED_GAME is correct too (Called when the local player finishes the join process if the player isn't the host)
-- and to call it we need to type ur function name
hook_event(HOOK_ON_PLAYER_CONNECTED, welcome_msg)
yeah i did some stuff wrong such as the hook having the function be 2, but u dont need to check if the index = 0... just use HOOK_JOINEDWrong you gotta gotta be like this
Code:-- Functions is always important ---@param m MarioState The Mario function welcome_msg(m) -- we only want show for local player in screen (yes YOURSELF in screen) if m.playerIndex ~= 0 then return end -- if message is not equal to true we make it to true (stops it from spam) if welcomemsg ~= true then welcomemsg = true djui_popup_create("Welcome!, 2) -- creates a popup the "" is the text the, 2 is seconds to disappear raise it to make longer (duration) end -- closes if then end -- closes the function -- dont use incorrect hooks go to official sm64coopdx lua guide and hooks to see all hooks -- HOOK_ON_PLAYER_CONNECTED is the correct hook it is called every time when a player joins the server (Called when a player connects) HOOK_JOINED_GAME is correct too (Called when the local player finishes the join process if the player isn't the host) -- and to call it we need to type ur function name hook_event(HOOK_ON_PLAYER_CONNECTED, welcome_msg)
You cant read comments in my code? HOOK_JOINED_GAME is correct hook and you used it was correct only thing that caused script errors in your code you added 2 instead of adding function name in hookyeah i did some stuff wrong such as the hook having the function be 2, but u dont need to check if the index = 0... just use HOOK_JOINED
-- my comment