local plr = game.Players.LocalPlayer local char = plr.CharacterAdded;wait() local humanoid = char:FindFirstChild("Humanoid") humanoid.Health = 0 humanoid.Died:connect(function() wait(4) if plr.leaderstats.Stage.Value == 1 then char.Torso.CFrame = CFrame.new(workspace.Spawns.Stage1Spawn.Position) + Vector3.new(0,2,0) end end)
00:18:53.756 - ServerScriptService.StageSpawning:2: attempt to index local 'plr' (a nil value)
also, stop removing my questions i just want this script fixed then i will stop
Okay, so, if this isn't in a local script, it won't work. if it isn't in a local script, I advise you put it in one.
You should use break joints instead of changing the health
local plr = game.Players.LocalPlayer local char = plr.CharacterAdded;wait() local humanoid = char:FindFirstChild("Humanoid") plr:BreakJoints() humanoid.Died:Connect(function() wait(4) if plr.leaderstats.Stage.Value == 1 then char.Torso.CFrame = CFrame.new(game.Workspace.Spawns.Stage1Spawn.Position) + Vector3.new(0,2,0) end end)
You should just use the exact coordinates of the spawn if the game.Workspace section doesnt work. Also, use :Connect instead of :connect and game.Workspace rather than .workspace.