I'm working on a small clicker game and my biggest issue right now is actually adding the currency when the button is clicked. I don't see anything issues here but maybe someone can find it because I've had this issue for a lot of other games I've done.
My localscript for the button.
local add = game.ReplicatedStorage.Remotes.ClickEvent
local plr = game.Players.LocalPlayer
local lstats = plr:WaitForChild("leaderstats")
local ice = lstats:WaitForChild("Ice").Value
local click = lstats:WaitForChild("Ice per Click").Value
local gui = script.Parent
gui.MouseButton1Click:Connect(function()
add:FireServer(plr)
end)
gui.MouseEnter:Connect(function()
gui:TweenSizeAndPosition(UDim2.new(0.6,0,0.8,0),UDim2.new(0.4,0,0.2,0),"Out","Quint",0.25)
end)
gui.MouseLeave:Connect(function()
gui:TweenSizeAndPosition(UDim2.new(0.45,0,0.6,0),UDim2.new(0.475,0,0.3,0),"Out","Quint",0.25)
end)
My script for the remote event.
script.Parent.OnServerEvent:Connect(function(plr)
local lstats = plr:FindFirstChild("leaderstats")
local click = lstats:FindFirstChild("Ice per Click")
local ice = lstats:FindFirstChild("Ice")
ice.Value = ice.Value+click.Value
end)
It just doesn't seem to work ad I can't find the issue because there is no issue in the output.

6 comments
I evened tried to remove the locals from the localscript but that didn't work.
You don't need to pass the player through :FireServer, since roblox does this for you already.
Ok, if I remove the plr from the localscript in the :FireServer thing, it still isn't fixed.
Did I say it would fix the problem? No. It just removes redundancy. In the server script call print. See if there's any output. Like print("The server received request");
Nope. The server doesn't receive the request. I made a print and it didn't show anything in the output.
Is the script inside the RE, i'm guessing it is