My game is based off of leaderstats, and I need this code to change stats for that specific player that clicked on all clients, not just localy. This is the LocalScript in Gui
script.Parent.MouseButton1Click:connect(function()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ClickEvent = ReplicatedStorage:WaitForChild("ClickEvent")
ClickEvent:FireServer()
end)
This is the ServerScript in Workspace
local ReplicatedStorage = game:GetService("ReplicatedStorage")
ClickEvent = ReplicatedStorage:WaitForChild("ClickEvent")
local function onClickFired(player)
local clickz = player.leaderstats.Clicks.Value
clickz = clickz + 1
local point = player.leaderstats.Points.Value
point = point + 1
end
ClickEvent.OnServerEvent:Connect(onClickFired)
I REALLY need your help.
while true do
wait(1)
If game.Players.Admin8483.Questions["Help with changing stats with FilteringEnabled?'].Answered.Value == true then
local Answerer = game.Players.Admin8483.Questions["Help with changing stats with FilteringEnabled?'].AcceptedAnswer.Answerer.Value
print(Answerer.." is the best person ever!")
else
wait(1)
end
--Lol just something made by me, the noobish scripter

1 comment
Are there any errors?