Hi.
I am making a game module, and when I team the player to be on the lobby team when they are out, it works. But, when I call Player:LoadCharacter(), it doesn’t teleport the player back to their spawn point.
I tried printing the players team, and it says Lobby.
I tried using Player.Character.Humanoid.Health = 0 but it doesn’t work either.
I tried setting the Player’s primary part to a random spawn but it doesn’t work either
I tried disabling my anti-exploit but it still doesn’t work
Script:
ReplicatedStorage:WaitForChild("Values"):WaitForChild("Teams"):FindFirstChild(Team1).Value = true
for _, Player in pairs(Players:GetPlayers()) do
if Player and Player.Team == Team then
Player.Team = Teams:FindFirstChild("Lobby")
print(Player.Team)
local vector = Panna.randomSpawn()
Player:LoadCharacter()
--Player.Character:SetPrimaryPartCFrame(vector)
task.wait(6)
Panna.resetonOut()
end
end
Any help would be appriciated, thanks!