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

Negative money Reset Not Work ?

Well Can You Help Me Why This wont Work ? This The Script , Its' On starter gui , Screen Gui , Script

if script.Parent.Parent.Parent.leaderstats.Cash.Value == -2147483648 then
	script.Parent.Parent.Parent.leaderstats.Cash.Value = 250000000
end

2 comments

0

Theres nothing wrong with that bit of code, but how you use it may effect something. And why such a specific number? Elaborate the question a bit. Include more of the script please.

0

Actually, 250000000 might be too high.

1 answer

✓ Accepted answer

-snip-

If you want to check if a number is negative, check if it is less than 0:

if script.Parent.Parent.Parent.leaderstats.Cash.Value < 0 then
    script.Parent.Parent.Parent.leaderstats.Cash.Value = 2147483647 --You were right about that being too big, by the way.
end

Honestly, though, you should just use sane values so you don't have to deal with integer wrapping, or just use Strings.

2 comments

0

Normal scripts do run in the PlayerGui. (just verified to be sure)

0

Weird. Every time I've tried they haven't worked. Ah well. (People still should use LocalScripts in the PlayerGui, though)

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