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

How do you fix GUI button clicking and player reloading?

So, I made a script where If I click this button then changes my data value and it does nothing...

local MainGUI = script.Parent local Player = game.Players local Players = game:GetService("Players")

MainGUI.MouseButton1Down:Connect(function(player,character) local Data = Players:WaitForChild"Data" Data.Stand.Value = 2 print("BUTTON NERD") Players:LoadCharacter() end)

1 answer

✓ Accepted answer

If it is a local script, then it is likely not working as it is only changing the value on the client, and not the server (where you would probably and should be checking for the players stands, as exploiters can modify the client). Try either making it a server script (not recommended) or a local script but add a remote event and check on the server for if it is legit (to stop exploiters from doing infinite rerolls without currency for example)

2 comments

0

The server script option is easier but you should always aim to have GUI on the client, the server should be running only important info such as datastores and damage

0

This is also why you should replicate visual effects across clients

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