Hello, I am making a border game, I am having struggles with the team changing via a script. I made a gui and a countdown, but I want that after that certain countdown is over a script that changes you back to the immigrant team instead of the prisoners team.
If you can make me an advanced one (I dont need it, If you can then thanks), like whenever they leave and rejoin they are still in the prisoners team.
Hi. Even though this is not a request website, I will gladly answer your question.
Try using the team service and the player's property "Team".
Example
local teams = game:GetService("Teams") local desiredteam = teams.Immigrants -- or anything you'd like game.Players.PlayerAdded:Connect(function(plr) -- plr is the parameter for the player who just joined if plr.Team == "Prisoners" then -- or whatever the jailed teams is wait(100) -- time in jail, you can change it. plr.Team = desiredteam end end)
This should make a player join the team, and if he is in the prisoners team, it will wait 100 seconds, and then team him immigrant. Enjoy.
This is not a request site. We will not write your scripts for you. That being said, I have a few tips for you. You can change a players team relatively easily with the Team property. Example:
player.Team = -- team you choose
To be able to change their team though, you will need to have the team object that you are going put them into. Example:
local teams = game:GetService("Teams") -- the recommended way of getting any service is :GetService() Services include: Players, ServerStorage, ReplicatedStorage, Teams, and so on local teamWeWant = teams:FindFirstChild("immigrants") -- I took the team name from your explanation player.Team = teamWeWant
I hope this helps and have a great day scripting!