Electrosumm Posted July 27, 2016 Share Posted July 27, 2016 Hello guys im try to make a script which is creating a Team ,but its not working. function newTeam( source, TeamName ) theGMTEAM = createTeam("GM TEAM") if theGMTEAM then setPlayerTeam(source, theGMTEAM) end end addCommandHandler("st", newTeam) line 2 attempt to call global createTeam(nil value) How can i fix it ? Link to comment
bosslorenz Posted July 27, 2016 Share Posted July 27, 2016 Do you mean once the command executed, team created and you want the one who executed the command be put in that team? Or just a command that creates a team? Link to comment
Electrosumm Posted July 27, 2016 Author Share Posted July 27, 2016 I mean its create the "GM TEAM" and yes i want to put the player to this team Link to comment
Hale Posted July 27, 2016 Share Posted July 27, 2016 Try this: function newTeam( source, command, teamName ) if teamName then createTeam(teamName) local myTeam = getTeamFromName(teamName) if (myTeam ~= nil) then setPlayerTeam(source, myTeam) end end end addCommandHandler("st", newTeam) BUT this function is /st GM TEAM, you choose your own name for the team. Link to comment
bosslorenz Posted July 27, 2016 Share Posted July 27, 2016 Hello guys im try to make a script which is creating a Team ,but its not working. function newTeam() createTeam("GM TEAM") end addCommandHandler("st",newTeam) This should create a team when you execute a command (/st). Link to comment
Electrosumm Posted July 27, 2016 Author Share Posted July 27, 2016 Now i getting no errors but its not create any team Link to comment
bosslorenz Posted July 27, 2016 Share Posted July 27, 2016 Yeah b'coz Luka doesn't know what he is commenting just like what he is doing on my posts. Try my script it should work fine. Link to comment
Electrosumm Posted July 27, 2016 Author Share Posted July 27, 2016 line 2 createTeam a nil value Link to comment
bosslorenz Posted July 27, 2016 Share Posted July 27, 2016 line 2 createTeam a nil value What scripts are you using bcoz my scripts works fine to me. Link to comment
Hale Posted July 27, 2016 Share Posted July 27, 2016 Yeah b'coz Luka doesn't know what he is commenting just like what he is doing on my posts. Try my script it should work fine. What's your problem pal, why do you have to be so immature? Are you sure that you're typing the command correctly? Like I said, you must type /st GM TEAM Link to comment
Electrosumm Posted July 27, 2016 Author Share Posted July 27, 2016 i tryed all and nothing works for me. Link to comment
bosslorenz Posted July 27, 2016 Share Posted July 27, 2016 function createGMTEAM(source) ex = createTeam("GM TEAM") setPlayerTeam(source,ex) end addCommandHandler("gm",createGMTEAM) You should type /gm on *T* chat and this will create a GM TEAM and automatically puts you in that team. Other is like ex = createTeam("GM TEAM") function makemeGM(source) setPlayerTeam(source,ex) end addCommandHandler("gm",makemeGM) 2nd script the GM TEAM is already created and you just have to type /gm in *T* chat to get you on that team. 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