Roblox Studio - How To Handle Data #1 [In-Game Leaderboard]

Опубликовано: 01 Август 2026
на канале: Kinfolk Studio
148
9

This video will give you a general idea of how to create different types of data and how to organize them in Roblox Studio, we will also talk about how to create and handle the in-game leaderboard.

CreateServerData script:
local function NewGameSetup()
local CurrentHourInGame = Instance.new("IntValue", script.Parent)
CurrentHourInGame.Name = "CurrentHourInGame"
local CurrentMinuteInGame = Instance.new("IntValue", script.Parent)
CurrentMinuteInGame.Name = "CurrentMinuteInGame"
end

NewGameSetup()

CreatePlayerData script:
local Players = game:GetService("Players")

local function NewGameSetup(Player)

local InGameData = Instance.new("Folder", Player)
InGameData.Name = "InGameData"

local SavedData = Instance.new("Folder", Player)
SavedData.Name = "SavedData"

local leaderstats = Instance.new("Folder", Player)
leaderstats.Name = "leaderstats"

local Level = Instance.new("IntValue", SavedData)
Level.Name = "Level"

local Exp = Instance.new("IntValue", SavedData)
Exp.Name = "Exp"

local Gold = Instance.new("IntValue", SavedData)
Gold.Name = "Gold"

local SessionPlayedTime = Instance.new("IntValue", InGameData)
SessionPlayedTime.Name = "SessionPlayedTime"

local LevelLS = Instance.new("IntValue", leaderstats)
LevelLS.Name = "Level"

local GoldLS = Instance.new("IntValue", leaderstats)
GoldLS.Name = "Gold"
end

Players.PlayerAdded:Connect(function(Player)
NewGameSetup(Player)

Player.SavedData.Level:GetPropertyChangedSignal("Value"):Connect(function()
Player.leaderstats.Level.Value = Player.SavedData.Level.Value
end)

Player.SavedData.Gold:GetPropertyChangedSignal("Value"):Connect(function()
Player.leaderstats.Gold.Value = Player.SavedData.Gold.Value
end)

end)