I have two teams police and prisoners. i puted around the prison spawnpoints and set them to change team when touch. but i want this to work only with prisoners because when i exit the prison as a police officer it changes my team to criminals.How do i make this work only with prisoners team???
Firstly turn off the change team thing in the spawn points, we will do it using scripts. Create a "Folder" in the Workspace called "CriminalSpawns" and put all the criminal spawns in that folder. Now create a script in ServerScriptService and put in the following.
for i,v in pairs(workspace.CriminalSpawns:GetChildren()) do v.Touched:Connect(function(hit) if hit.Name == "HumanoidRootPart" then local player = game.Players:FindFirstChild(hit.Parent.Name) if player.Team = game.Teams:FindFirstChild("Prisoners") then player.Team = game.Teams:FindFirstChild("Criminals") player.Neutral = false end end end) end
If that doesn't work DM me on discord MachoPiggies#3484!