I tried using this script to make it so when you touched it you could change to its team, but then after a second it wouldn't. (This is the beginning of a round)
game.Workspace.Field1.Spawn1.AllowTeamChangeOnTouch = true wait(1) game.Workspace.Field1.Spawn1.AllowTeamChangeOnTouch = false
It didn't work obviously. Is there anyway to fix this?
What do you mean it didnt work? If you were to logically translate this in English. It would be: You can changes teams...(One second passes by) You cant change teams. You're changing window is only open for 1 seconds. Then it becomes false. I don't get what's to fix.
how are you calling this in your script?? Because if you don't have this in a function it will execute as soon it loads the script.
are you calling like this game.Workspace.Field1.Spawn1.Touched:connect(Value_Changer)
?
function Value_Changer() game.Workspace.Field1.Spawn1.AllowTeamChangeOnTouch = true wait(1) game.Workspace.Field1.Spawn1.AllowTeamChangeOnTouch = false end
It would probably be better to keep that property enabled. Or for some reason if you want it disabled, change the player who touched the spawn's TeamColor property to the Spawn's TeamColor property.
local part = game.Workspace.Field1.Spawn1; part.Touched:connect(function(hit) local player = hit and hit.Parent and Game.Players:GetPlayerFromCharacter(hit.Parent); if player then player.TeamColor = part.TeamColor; player.Neutral = part.Neutral; --Just to make sure they are neutral if the spawn is neutral. end end);