I want it so when a player touches a part it will make there spawn point that part. Here's what I tried,
script.Parent.Touched:connect(function(part)
if part.Parent:FindFirstChild("Humanoid").Health ~= 0 then
local plr = game.Players:GetPlayerFromCharacter(part.Parent)
plr.RespawnLocation = script.Parent
end
end)
ERROR OUTPUT 00:21:20.546 - -bad cast-
00:21:20.547 - Script 'Workspace.Checkpoint.Script', Line 4
00:21:20.547 - Stack End
Problem,
plr.RespawnLocation = script.Parent
So I'm guessing you can't use RespawnLocation to "change" the players spawn point? Do you guys know what I'm doing wrong?

1 comment
Yeah, that cleared up a bit of confusion. Thanks!