Jaysds1 Posted March 17, 2011 Share Posted March 17, 2011 I need help creating a button linking to a team, making a person/client spawn on that team. Link to comment
Castillo Posted March 17, 2011 Share Posted March 17, 2011 --client side function selectTeam() triggerServerEvent("setTeam",getLocalPlayer()) end addEventHandler("onClientGUIClick",yourButtonElement,selectTeam,false) --server side addEvent("setTeam",true) addEventHandler("setTeam",getRootElement(), function () setPlayerTeam" class="kw6">setPlayerTeam(source,getTeamFromName("Some_Team")) outputChatBox("Your team has been set!", source) end) Link to comment
Jaysds1 Posted April 29, 2011 Author Share Posted April 29, 2011 How do you connect this to the spawn window with the 2 buttons Link to comment
Castillo Posted April 30, 2011 Share Posted April 30, 2011 yourButtonElement = guiCreateButton(blabla) You will have something else, that's why i put yourButtonElement for you to change it. 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