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

Scripting Help? (Easy)

Im just getting into scripts and I have this Gui tycoon (located in StarterGuis) for collecting cash and.. For some reason every time you reset, The cash goes back down to 0. Can anyone please help? Thanks!

This is the script

function oc()
script.Parent.Parent.Money.Value = script.Parent.Parent.Money.Value + script.Parent.Parent.Collect.Value
script.Parent.Parent.Collect.Value = 0
end
script.Parent.MouseButton1Down:connect(oc)

1 answer

✓ Accepted answer

I'm guessing that the 'Money' value is in the player's PlayerGui? If so, the reason this is occurring is because when a player respawns their PlayerGui is cleared and replaced with what's in StarterGui.

To fix the issue you've come across, either move the 'Money' value to the player's player object, in the Players service - Or prevent their PlayerGui from resetting by toggling the "ResetPlayerGuiOnSpawn" property of StarterGui.

1 comment

0

Thank you so much! Iv been trying for days to fix it x3

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