How do I code DJUI messages that show when a player joins?

what are you trying to do? theres quite a bit of DJUI stuff and it changes depending on your need. explain furthur what you want to do with them so i can help out
 
i'm trying to make a welcome message popup in chat
Don't double post! Use that edit button! Post automatically merged:

hello?
 
Last edited:
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
that wont work just by itself...
Don't double post! Use that edit button! Post automatically merged:

i'm trying to make a welcome message popup in chat
Don't double post! Use that edit button! Post automatically merged:

hello?
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)"

should look like this:
Code:
--only for that specific persons screen
function join_msg_local()
    djui_popup_create("Hi there!", 2)
end

hook_event(HOOK_JOINED_GAME, 2)

Code:
--for everyones screen
function join_msg_global()
    djui_popup_create("Hi there!", 2)
end

hook_event(HOOK_ON_PLAYER_CONNECTED, 2)
 
Last edited:
Wrong 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)
 
Last edited:
Wrong 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)
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_JOINED
 
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_JOINED
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 hook
But commments in code looks like this
Code:
-- my comment
 

Users who are viewing this thread