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

How to change IntValue using a script?

I was wondering how to change the value of an IntValue using a script but it isn't working. I am trying to make a currency system. Here is the code I have (new to scripting in Roblox): `local playerdata = game.Players.LocalPlayer:WaitForChild("leaderstats")

if playerdata.Coins.Value == 0 then
	playerdata.Coins.Value = 20000

end`

2 answers

Your code should work only if the Value of Coins is 0.

2 comments

0

are you getting any errors cause that codes should work

0

Did you made the leaderstats and coins

@JustinWe12 The value of my coins is set to 0, and my error for anyone else is "ServerScriptService.Script:1: attempt to index nil with 'WaitForChild' - Server - Script:1"

Any other ideas?

2 comments

0

You Idiot Send The Whole Script

0

Wow, how rude, I sent the script in my first post, go to school for once in your life

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