How Can I make it so when I click GUI It gives me value

in the script or local script?

In the local script please thx

Fire the remoteevent from your localscript and let the server look for the right value of the right player and let the server change it to the right value.

did you create a leaderstats folder? I think game:GetService(“Players”).LocalPlayer doesnt need waiting

Script.parent.mousebutton1click:connect(function()
game.replicatedstorage.remoteevent:fireserver()
end)

I think the core script should still be working, but only the clientside

Then insert a server script into server script service and say game.replicatedstorage.remoteevent.onserverevent:connect(function(plr)
plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value +10
end)

local script into textbutton: script.parent.mousebutton1click:connect(function()
game.ReplicatedStorage.OnClick:FireServer()
end)
script into text button:local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 10
someone copy this and make it like correct it’ll be a pleasure

No delete the script in if text button and leave the local script

26 replies is too much for this thing let me typ what you need to do:

Insert a remoteevent

Insert a serverscript

game.ReplicatedStorage.RemoteEvent.OnServerEvenr:Connect(function(plr)
local plr = game.Players:FindFirstChild(plr.Name)
plr.Leaderstats.Value = plr.Leaderstats.Value + 100
end

Insert a localscript

script.Parent.MouseButton1Click:Connect(function(click)
game.ReplicatedStorage.RemoteEvent:FireServer
end

(Expect some little mistakes bcs i typed it on my Iphone)

ohhhh okay thanks post must be at leat 30 characters

U don’t need plr as a variable since there is already a lot argument

Plr* argument is what I meant sorry

Did it work? Once again do the steps I have told u to do

This works too but it is a longer way :slight_smile:

Localscript

local Players = game:GetService(“Players”)
local player = Players.LocalPlayer

[button].Activated:Connect(function()
game.ReplicatedStorage.OnClick:FireServer()
end)

Script:

game.ReplicatedStorage.OnClick.OnServerEvent:Connect(function(player)
player.leaderstats.Cash.Value += 10
end)

This should work if I’m correct.

Haha u made me laugh alright as long as it works it’s fine lol

so local script into textbutton and script into serverscriptservice?

No activated is for a tool mouse click is for a button

Replace [button] with the button that you want to be clicked to fire the event.
Ex: If you put the script in the button, you could do script.Parent.Activated