Here's the code I have:
local players = game:WaitForChild("Players") local function createLeaderboard(player) local stats = Instance.new("Folder") stats.Name = "leaderstats" local rank = Instance.new("IntValue", stats) rank.Name = "Rank" rank.Value = 0 stats.Parent = player end players.PlayerAdded:connect(createLeaderboard)
Here's the code I want:
local players = game:WaitForChild("Players") local function createLeaderboard(player) local stats = Instance.new("Folder") stats.Name = "leaderstats" local rank = Instance.new("IntValue", stats) rank.Name = "Guest" -- I know it's an error. rank.Value = 0 stats.Parent = player end players.PlayerAdded:connect(createLeaderboard)
The last code had an error. Could you help me?
If you want a leaderstats value to have letters, you need a StringValue, not an IntValue. IntValues take whole numbers, while StringValues take strings (or text)
local players = game:WaitForChild("Players") local function createLeaderboard(player) local stats = Instance.new("Folder") stats.Name = "leaderstats" local rank = Instance.new("StringValue", stats) rank.Name = "Guest" rank.Value = "Guest" -- change "guest" to the rank you want stats.Parent = player end players.PlayerAdded:connect(createLeaderboard)