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

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

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?

2 comments

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

0

what is currencyName?

2 answers

✓ Accepted answer

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.

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.

1 comment

0

Thanks!

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