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)
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.