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

This leaderstats script not functioning properly?

Asked by 4 years ago

Ok, here is my script:

1game.Players.PlayerAdded:Connect(function(plr)
2       local money = Instance.new(“IntValue”, plr)
3       money.Parent = plr
4end)

2 answers

Log in to vote
0
Answered by 4 years ago

Okay here is the fix:

1game.Players.PlayerAdded:Connect(function(plr)
2-- You forgot the leaderstats folder, the money val, and the name
3    local leaderstats = Instance.new("Folder",plr)
4       local money = Instance.new(“IntValue”)
5       money.Parent = leaderstats
6    money.Name = "money"
7    money.Value = 0
8end)

Hope it helps!

0
The parent argument of Instance.new() is deprecated. qVoided 221 — 4y
0
Those quotation marks aren't UTF-8 compatible. youtubemasterWOW 2741 — 4y
0
Ik, I was typing on iPad, I hope ThatWorldDev understands that and changes them. alexfinger21 341 — 4y
0
Yeah, I ddI ThatWorldDev 2 — 4y
Ad
Log in to vote
0
Answered by
qVoided 221 Moderation Voter
4 years ago
Edited 4 years ago

You need a folder called "leaderstats".

Here is an example:

01game.Players.PlayerAdded:Connect(function(plr)
02    local leaderstats = Instance.new("Folder")
03    leaderstats.Name = "leaderstats"
04    leaderstats.Parent = plr
05 
06    local money = Instance.new("IntValue")
07    money.Name = "Money" -- You can change this
08    money.Parent = leaderstats
09        money.Value = 30 -- You can change this
10end)

Remember, if this answer helped, please upvote and accept, it helps! :)

Answer this question