So I was making a basic clicking simulator code,
local button = script.Parent
local player = game.Players.LocalPlayer
local clicks = player:WaitForChild(“leaderstats”):WaitForChild(“Clicks”)
script.Parent.MouseButton1Click:Connect(function()
clicks.Value = clicks.Value +1
end)
It works fine its just I can not see other peoples stats. Maybe I wrote the code wrong or its a local script? I am new to coding so I am un sure.
It’s a localscript and only changes for yourself
so use Script to make change to the stats!
1 Like
Before going into game development, I strongly advise you to read this article:
To summarize, your code will only work locally since it’s in a LocalScript.
Any changes made on the client will not replicate on the server. Read the above doc for more information.
1 Like
Its cause you are changing the value on a local script.
This means that only the player(That meaning you)
To fix this you will have to change the value on the server.
I recommend learning about RemoteEvents.
Also yes what @TheRealANDRO said.
1 Like
Thank you everyone thanks to you I can continue my work. I found a new way for the code to work server sided.
3 Likes
system
(system)
Closed
May 7, 2023, 12:39am
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.