Hello! I created a local script for checkpoints, but for some reason it does not work locally. What could be the problem?
local player= game:WaitForChild("Players").LocalPlayer local character = player.Character local CheckpointData = script.CheckpointData local CheckpointValue = script.CheckpointData.CheckpointValue for i, v in pairs(game.Workspace.CheckpointFolder:GetChildren()) do if v:IsA("Part") then function onTouch() CheckpointValue.Value=v.Position end v.Touched:connect(onTouch) end end for i, v in pairs(game.Workspace.Obby.KillPart:GetChildren()) do if v.Name == "KillPart" then function onTouch() player.Character:MoveTo(CheckpointValue.Value) game.ReplicatedStorage.Death:FireServer(player) end end end v.Touched:connect(onTouch) end
Remove the first line. FindFirstChild checks parts, folders, etc. You are checking a string value. To do that, you'd do
repeat until not game.Players.LocalPlayer == nil
Its also not needed, as client scripts run when there is a client