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

Checkpoint Script broken?[Unsolved]

Asked by 10 years ago

Can someone help me, i'm not sure if there is anything wrong with it but I have a checkpoint script but at some point if you play it respawn, you respawn in mid air then die then respawn at your Checkpoint.

function oa(object)
local player = game.Players:playerFromCharacter(object)
if player ~= nil then
local ls = player.leaderstats
local sl = game.Workspace:FindFirstChild(ls.Stage.Value)
print("gah")
object.Torso.CFrame = object.Torso.CFrame + Vector3.new(0,3,0)
wait()
object.Torso.CFrame = sl.CFrame + Vector3.new(0,3,0)
end end

function oe(object)
if object.className == "Player" then
local ack = Instance.new("IntValue")
ack.Name = "leaderstats"
local ack2 = Instance.new("IntValue")
ack2.Name = "Stage"
ack2.Value = 1
ack2.Parent = ack
ack.Parent = object
end end

game.Players.ChildAdded:connect(oe)
game.Workspace.ChildAdded:connect(oa)

and this is the Script inside the Spawn:

function ot(hit)
if hit.Parent ~= nil then
local player = game.Players:playerFromCharacter(hit.Parent)
if player ~= nil then
if player.leaderstats.Stage.Value == script.Parent.Name - 1 then
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
if h.Health ~= 0 then
player.leaderstats.Stage.Value = script.Parent.Name
end end end end end end

script.Parent.Touched:connect(ot)

1 answer

Log in to vote
0
Answered by
istiyak 13
10 years ago

have you anchored the spawn because something like this happened to me

0
Yea my spawns are anchored. tempodoa 0 — 10y
0
And i was wondering why would you want to put a script on your checkpoint istiyak 13 — 10y
Ad

Answer this question