So I'm making a clicking thing, and every time you click a brick the brick changes color, changes your click value in Workspace, and updates the GUI that says how many clicks you have. It works perfectly fine in studio, but in the real thing, it doesn't work. Help? Here is the code.
function onClicked(playerWhoClicked) game.Workspace.Clicks.Value = game.Workspace.Clicks.Value + 1 game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel.Text = ("Clicks : ".. game.Workspace.Clicks.Value) script.Parent.BrickColor = BrickColor.random() end script.Parent.ClickDetector.MouseClick:connect(onClicked)
If you could help it would be greatly appreciated. Thanks!
FilteringEnabled is turned on. Keep it on, just update your scripts.
You shouldn't really need a RemoteEvent in this case so;
In a ServerScript, put;
function onClicked(playerWhoClicked) game.Workspace.Clicks.Value = game.Workspace.Clicks.Value + 1 script.Parent.BrickColor = BrickColor.random() end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Then make a LocalScript, in the TextLabel, and in it put;
game.Workspace.Clicks.Changed:Connect(function() script.Parent.Text = ("Clicks : " .. game.Workspace.Clicks.Value) end)
If you want it to record only how many times one person has clicked the button, that's a whole different story. Reply to this if that's what you need.