Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my checkpoint respawn script acting up?

Asked by
sad_eyez 162
6 years ago
Edited 6 years ago

This script works perfect in studio, and was working perfect in the actual game to, but for some reason it isn't working in the actual game now.

local char = script.Parent
local plr = game.Players:GetPlayerFromCharacter(char)
local stage = plr:WaitForChild("leaderstats"):WaitForChild("Stage")

for i,v in pairs(workspace:GetChildren()) do
    if v.Name == "Checkpoint"..tostring(stage.Value) then
        if char:FindFirstChild("Torso") then
        local torso = char:FindFirstChild("Torso")
        wait()
        torso.CFrame = CFrame.new(v.Position.X, v.Position.Y + 5.5, v.Position.Z)
        elseif char:FindFirstChild("LowerTorso") then
        local lowertorso = char:FindFirstChild("LowerTorso")
        wait()
        lowertorso.CFrame = CFrame.new(v.Position.X, v.Position.Y + 5.5, v.Position.Z)
        end
    end
end

0
You should use invisible checkpoint pads. Also, when teleporting, I like using the head because it is used in R15 and R6. hiimgoodpack 2009 — 6y
0
I tried the head and it doesn't even teleport in studio, let alone the actual game sad_eyez 162 — 6y

Answer this question