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

My Currency System is not working. What's the error?

My Currency System code is not working. I don't see the problem. Here's the code:

`local Player = game:GetService("Players")

Player.PlayerAdded:Connect(function(Player)

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

local gold = Instance.new("IntValue") gold.Name = Quint gold.Value = 100 end)

Player.PlayerRemoving:Connect(function(Player)

end)`

What is the problem in the code?

If you find a solution, thank you!

Sincerely,

Ducksneedhelp - New Scripter

1 answer

A simple mistake, You forgot to parent the leader-stats (Folder) to the player and made some tiny errors which I've fixed in the script down below!

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)

local leaderstats = Instance.new("Folder") 

leaderstats.Name = leaderstats

leaderstats.Parent = Player

local gold = Instance.new("IntValue") 

gold.Name = "Quint" 

gold.Value = 100

gold.Parent = leaderstats

end)

Player.PlayerRemoving:Connect(function(Player)

end)

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