local Teams = game:GetService("Teams")
local Character = player.Character or player.CharacterAdded:Wait()
-- spawnpoints
local blueSpawn = game.Workspace.team1
local redSpawn = game.Workspace.team2
if Humanoid.Health == 0 then
print(player.Name , " is dead..")
onDeath:FireServer(player , Humanoid)
task.wait(5)
if player.Team == Teams.Blue then
Character:MoveTo(blueSpawn.Position)
print(player.Name.."Has returned to blue spawn point [worked]")
end
end
i’m trying to make it so when a humanoid dies, or respawns. I want them to respawn at the blue location, but this isn’t working. Are there any other ways for this?
If it’s a SpawnLocation instance and the player is associated with that team, there’s a property within the instance that allows you to associate that SpawnLocation with the given team (I think by setting TeamColor). This means the player will always respawn at that location with no scripting involved.
Otherwise, you can set a part above the location with collisions off. You could then try something like: