Jump to content

onClientResourceStart GUI: Works for first player only


Recommended Posts

I have a onClientResourceStart hook below in my client script which is supposed to create a GUI when a player joins the server:

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        outputChatBox("testgui - " .. getPlayerName(localPlayer)) 
        informationWindow = guiCreateWindow(896, 199, 198, 256, "Additional Information", false) 
        guiWindowSetMovable(informationWindow, false) 
        guiWindowSetSizable(informationWindow, false) 
  
        informationHiddenHealthLabel = guiCreateLabel(10, 29, 178, 15, "Hidden Health", false, informationWindow) 
        informationHiddenHealthProgress = guiCreateProgressBar(9, 50, 179, 16, false, informationWindow) 
        guiProgressBarSetProgress(informationHiddenHealthProgress, 100) 
  
        informationSniperChargeLabel = guiCreateLabel(10, 76, 178, 15, "Sniper Charge", false, informationWindow) 
        informationSniperChargeProgress = guiCreateProgressBar(9, 101, 179, 15, false, informationWindow) 
        guiProgressBarSetProgress(informationSniperChargeProgress, 100) 
  
        informationBooChargeLabel = guiCreateLabel(9, 127, 179, 15, "Boo Charge", false, informationWindow) 
        informationBooChargeProgress = guiCreateProgressBar(9, 152, 179, 15, false, informationWindow) 
        guiProgressBarSetProgress(informationBooChargeProgress, 100) 
  
        informationSprintLabel = guiCreateLabel(9, 177, 179, 15, "Sprint", false, informationWindow) 
        informationSprintProgress = guiCreateProgressBar(9, 200, 177, 15, false, informationWindow) 
        guiProgressBarSetProgress(informationSprintProgress, 100) 
  
        informationDefendersLabel = guiCreateLabel(10, 231, 176, 15, "Defenders: 0", false, informationWindow) 
    end 
) 

Me and my friend joined the server and the testgui debug message was only sent to me and the GUI was only created for me.

Untitled.png

(Ignore the testguiaf and testguibf, those are unrelated)

I would appreciate if somebody could help me resolve this problem.

Thanks,

Ricky Phelps

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...