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

My currency script for a game i'm devloping for is not working. Anything I could have did wrong?

Asked by 4 years ago

This is the script: local currencyName = "Horrors"

game.Players.PlayerAdded:Connect(function(player)

 local folder = Instance.new("Folder")
 folder.name = "leaderstats"
 folder.Parent = player

 local currency = Instance.new("IntValue")
 currency.Name = currencyName
 currency.Parent = folder

end) I've rewritten it multiple times and it still doesn't work. Anything I possibly did wrong?

0
You should probably add what errors you got, what the script is supposed to be, where the script is located AND what type of script it is. lol fighterkirbyzx 102 — 4y
0
what is currencyName? Tyler090130 619 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

The code is fine. Except it's folder.Name, not folder.name the name in folder.name needs to be a capital letter. Also make sure it's a script, not a local script.

Ad
Log in to vote
0
Answered by 4 years ago

Your code is fine other than needing to change folder.name on line 2 to folder.Name, but you need to have this in a script, rather than a local script for it to work.

0
Thanks! TheROUGHbread2 0 — 4y

Answer this question