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

IS there an obby save progress script?

Asked by 3 years ago

Hi i am making a NEW dif chart obby and i want to know if there is any data saving scripts 4 obbies.

0
I edited my answer below with an example there are many ways to script it this is just 1 example jeboysisi 26 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

Hi,

I think you just need to have a datastore with a IntValue, and every time the players reaches the next stage the IntValue goes +1

then you make a script when the players joines he spawns on the stage thats equal to the IntValue, So for example you have a part on stage 5 thats named "5" and when the player joines with 5 as saved value he spawns on the part thats called 5

Here an Example of something like I mean:

I made a ModuleScript in ReplicatedStorage:

local module = {
    [1] = "Stage 1",
    [2] = "Stage 2"
}

return module

And this script I did in ServerScriptService:

local Module = require(game.ReplicatedStorage.ModuleScript)

game.Players.PlayerAdded:Connect(function(plr)

    local stats = plr:WaitForChild("leaderstats")
    local Stage = Module[stats.Stage.Value]
    if (Stage)then
        print(Module[stats.Stage.Value])
    end
end)

So basicly when Player.leaderstats.Stage.Value is 1 then it prints "Stage 1" and when it is 2 it prints "Stage 2"

Ad

Answer this question