Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I create an obby Auto-save?

Okay so my friend and myself are making an obby and I wanted to start on the Save/Load option. When testing the obby I noticed that when someone hits the first checkpoint something gets put into the server storage that allows them, when they die to go back to that location. Here is my attempt to take that information and have the Storage use that the next time the player logs in.


function onTouched(Part) = string("Touch")

local game.ServerStorage = string("Storage")

if player "Touch" game.Workspace.2 pcall "Storage" function save(local 
 game.ServerStorage.CheckpointData);
	
end 

Please help me as I do not know LUA but a bit of C++ and a bit of C#.

4 comments

0

What is LUA?

0

LUA is a Programming Language, Roblox uses Roblox Lua to code...

0

Roblox uses Roblox Lua, not LUA. LUA == Love U Always. Roblox doesn't code in Love U Always.

0

Uh, what is this code?

1 answer

Then make leaderboard like "Stage" and make load gui

local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("GemSaveSystem")

game.Players.PlayerAdded:connect(function(plr)
 local folder = Instance.new("Folder", plr)
 folder.Name = "leaderstats"
 local stage = Instance.new("IntValue", folder)
 stage.Name = "Stage"

 stage.Value = ds1:GetAsync(plr.UserId) or 1
 ds1:SetAsync(plr.UserId, stage.Value)

 stage.Changed:connect(function()
  ds1:SetAsync(plr.UserId, stage.Value)
 end)
end)

Server script in Workspace

This discussion is preserved as it was. New answers, comments, and votes are closed.