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

Make a checkpoint and a save/load GUI?

Asked by 8 years ago

I am trying to build a fun obby for people to play, but I do not know how to make checkpoints. Can anyone tell me how to do it and the script I need to insert into it?

Aother question is, how do I make a Save/Load GUI? I need the script to insert into it.

0
Friend, I know you're maybe desesperated, but i'll say our Golden Rule: We aren't here to make scripts, just to help fixing them. So I advise you to learn a little of scripting and then come back when you have a lttle of effort. davness 376 — 8y
0
This is not a request forum. LittleBigKid2000 75 — 8y
0
i can help with the checkpoint system algerianqueen41 2 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

`local spawn = script.Parent spawn.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local checkpointData = game.ServerStorage:FindFirstChild("CheckpointData") if not checkpointData then checkpointData = Instance.new("Model", game.ServerStorage) checkpointData.Name = "CheckpointData" end

    local checkpoint = checkpointData:FindFirstChild(tostring(player.userId))
    if not checkpoint then
        checkpoint = Instance.new("ObjectValue", checkpointData)
        checkpoint.Name = tostring(player.userId)

        player.CharacterAdded:connect(function(character)
            wait()
            character:WaitForChild("HumanoidRootPart").CFrame = game.ServerStorage.CheckpointData[tostring(player.userId)].Value.CFrame + Vector3.new(0, 4, 0)
        end)
    end

    checkpoint.Value = spawn
end

end)`

what you have to do is insert a script into your spawn location and after rename it checkpoint script next you insert another script into your spawn location you can choose to rename it make sure to name all your spawn locations as numbers this will be the stage number

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)

Ad

Answer this question