Ricky Phelps Posted June 18, 2013 Share Posted June 18, 2013 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. (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
mcer Posted June 18, 2013 Share Posted June 18, 2013 Change "onClientResourceStart" to "onClientRender" Link to comment
Ricky Phelps Posted June 18, 2013 Author Share Posted June 18, 2013 I only need it done once and it still only executes for one player. Link to comment
denny199 Posted June 18, 2013 Share Posted June 18, 2013 It will only output on the client since it's a client script. And this might help you: https://wiki.multitheftauto.com/wiki/CenterWindow Link to comment
Castillo Posted June 18, 2013 Share Posted June 18, 2013 onClientResourceStart is triggered for the local player only when the client side script is loaded and started. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now