Do this is in a local script. Exploiters viewing GUIs they’re not supposed to won’t actually break your game.
Firstly, make a function that checks the coins value before updating the GUIs. If it’s just to show how many coins, set the Text property to the same as the coins Value property. I’m guessing your scenario is more sophisticated, so you may need to run a couple if statements to verify which GUIs should be open based off the coins.Value. Use inequality signs < and > to help you.
At the end of the script, simply bind this function to this event:
Your script should work perfectly. The only thing you haven’t done correctly is connect it to a Changed event:
if player.leaderstats.Coins.Value >= 125 then
game.Workspace.Part.ProximityPrompt.Enabled = true
script.Parent.Parent.Point1.Visible = false
script.Parent.Visible = true
else return "NAN" end
-- Data store code and value instancing goes here
if verifyCoins(plr) == "NAN" then
I’m not sure why it didn’t work since it is fine and there was no error in the Output. Where do I place my script? But for now, I’ll mark you as a Solution Post since I find that there is no error in the Script. But it somehow doesn’t work.