Amine#TN Posted April 19, 2017 Share Posted April 19, 2017 function joinUnem() setPlayerTeam(source,"Civil") end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) guys i want to make this script gives teams to the players without teams in my server only players without team Link to comment
Administrators Lpsd Posted April 19, 2017 Administrators Share Posted April 19, 2017 (edited) function joinUnem() if not getPlayerTeam(source) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) Edited April 19, 2017 by LopSided_ Link to comment
TorNix~|nR Posted April 19, 2017 Share Posted April 19, 2017 (edited) Try this, it should work. local team = createTeam("Civil", 0, 0, 0) -- Create the team, (0, 0, 0) Change the team color if you want. addEventHandler("onPlayerLogin", getRootElement(), function () setPlayerTeam(source, getTeamFromName("Civil")) -- set team 'Civil' on player Join. end) Edited April 19, 2017 by TorNix~|nR Link to comment
Amine#TN Posted April 19, 2017 Author Share Posted April 19, 2017 10 minutes ago, TorNix~|nR said: Try this, it should work. local team = createTeam("Civil", 0, 0, 0) -- Change the team color if you want addEventHandler("onPlayerLogin", getRootElement(), function () setPlayerTeam(source, getTeamFromName("Civil")) -- set team 'Civil' on playerJoin end) @TorNix~|nR that give the team for all the players with or without teams 21 minutes ago, LopSided_ said: function joinUnem() if not getPlayerTeam(source) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) that is not working Link to comment
Administrators Lpsd Posted April 19, 2017 Administrators Share Posted April 19, 2017 try function joinUnem() if (getPlayerTeam(source) == false) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) If that doesn't work then you'll need to show more of your code, such as team creation. Link to comment
Amine#TN Posted April 19, 2017 Author Share Posted April 19, 2017 i did not have a code i want just to give automatic team to players without team I have a semi RPG server you understand Link to comment
Administrators Lpsd Posted April 19, 2017 Administrators Share Posted April 19, 2017 I assumed you already had the team setup. This'll work local team = createTeam("Civil", 0, 0, 0) -- Change the team color if you want function joinUnem() if (getPlayerTeam(source) == false) then setPlayerTeam(source,getTeamFromName("Civil")) end end addEventHandler("onPlayerLogin",getRootElement(),joinUnem) Link to comment
Amine#TN Posted April 19, 2017 Author Share Posted April 19, 2017 that is working thanx guys 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