Lloyd Logan Posted January 19, 2013 Share Posted January 19, 2013 Hey, so i made a GUI and when you click "join" it sets you to the team, but its not working! team = createTeam ( "Bus Driver", 0, 255, 0 ) function teamSet(thePlayer, team) setPlayerTeam( thePlayer, team) end addEvent("sTeam", true) addEventHandler("sTeam", thePlayer, teamSet) Link to comment
Castillo Posted January 19, 2013 Share Posted January 19, 2013 Change "thePlayer" from addEventHandler to "root". Link to comment
Lloyd Logan Posted January 19, 2013 Author Share Posted January 19, 2013 Change "thePlayer" from addEventHandler to "root". I did that, the db 3 now says, Bad Arguement @ 'setPlayerTeam' Link to comment
3NAD Posted January 19, 2013 Share Posted January 19, 2013 createTeam ( "Bus Driver", 0, 255, 0 ) function teamSet ( ) local team = getTeamFromName ( "Bus Driver" ) if team then setPlayerTeam ( source, team ) end end addEvent ( "sTeam", true) addEventHandler ( "sTeam", root, teamSet ) if not working, put your client code. Link to comment
Lloyd Logan Posted January 19, 2013 Author Share Posted January 19, 2013 It now says, Bad 'player' pointer at @ 'setPlayerTeam' client function joinTeam(thePlayer) triggerServerEvent("sTeam", getRootElement(), "teamSet") end It is triggering it, so i am guessing the problem is Server side? Link to comment
Castillo Posted January 19, 2013 Share Posted January 19, 2013 function joinTeam() triggerServerEvent("sTeam", localPlayer, "teamSet") end Link to comment
Lloyd Logan Posted January 19, 2013 Author Share Posted January 19, 2013 function joinTeam() triggerServerEvent("sTeam", source, "teamSet") end Will this work with your code, or 3NAD's? Link to comment
Lloyd Logan Posted January 19, 2013 Author Share Posted January 19, 2013 Still nothing guys! server createTeam ("Bus Driver", 0, 255, 0 ) function teamSet ( ) local team = getTeamFromName ( "Bus Driver" ) if team then setPlayerTeam ( source, team ) end end addEvent ( "sTeam", true) addEventHandler ( "sTeam", root, teamSet ) client function joinTeam() triggerServerEvent("sTeam", source, "teamSet") end Link to comment
3NAD Posted January 19, 2013 Share Posted January 19, 2013 At ' triggerServerEvent ', the source is not Defined. use ' localPlayer ' Link to comment
Lloyd Logan Posted January 19, 2013 Author Share Posted January 19, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' Atlast!! It works, Thank You! Link to comment
Smart. Posted January 19, 2013 Share Posted January 19, 2013 You can use 'root' as argument at triggerServerEvent and then use 'client' as player argument server sided Link to comment
Castillo Posted January 20, 2013 Share Posted January 20, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow. Link to comment
3NAD Posted January 20, 2013 Share Posted January 20, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow. No problem, i Saw it Link to comment
Lloyd Logan Posted January 20, 2013 Author Share Posted January 20, 2013 At ' triggerServerEvent ', the source is not Defined.use ' localPlayer ' I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow. Is that what was happening yesterday? I tried to get on sometimes it would let me and sometimes it would give me a HTTP 500 error. Normally the forums are ultra fast for me because of my connection l, oh well! 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