Why is this not working? it is placed in StarterGui.
local player = game.Players.LocalPlayer local spawn = player:WaitForChild("ds"):WaitForChild("Spawn") local brick = game.Workspace.Spawns Player = game:GetService("Players").LocalPlayer Player.CharacterAdded:connect(function(character) if spawn.Value == 0 then player.Character.Torso.CFrame = CFrame.new(3, 0.2, 1) end if spawn.Value == 1 then player.Character.Torso.CFrame = CFrame.new(53, 0.2, 1) end end)
The script in the player's PlayerGui will be loaded every time the player respawns, which means CharacterAdded will not fire because the character already exists.
Instead, just define character as character=Player.Character
To elaborate on what 1waffle1 said basically what happens is that CharacterAdded never fires because by the time the LocalScript has loaded the Character will have already spawned. So a way around this issue is to do this.
local player = game:GetService("Players").LocalPlayer local spawn = player:WaitForChild("ds"):WaitForChild("Spawn") local brick = workspace.Spawns repeat wait() until player.Character local torso = player.Character:WaitForChild("Torso") if spawn.Value == 0 then torso.CFrame = CFrame.new(3, 0.2, 1) end if spawn.Value == 1 then torso.CFrame = CFrame.new(53, 0.2, 1) end
Hopefully this helps :)