I have made 3 leaderstats like this:
game.Players.PlayerAdded:Connect(function(Player) local Stats = Instance.new('Folder',Player) Stats.Name = 'leaderstats'
local Robux = Instance.new('IntValue',Stats)
Robux.Name = 'Robux'
Robux.Value = 0
local Amount = Instance.new('IntValue',Stats)
Amount.Name = 'Amount'
Amount.Value = 1
end)
the script is in ServerScriptService. I have made a GUI button with this local script:
local Player = game.Players.LocalPlayer local PlayerStats = Player:WaitForChild('leaderstats'):WaitForChild('Robux') local Amount = Player:WaitForChild('leaderstats'):WaitForChild('Amount')
script.Parent.MouseButton1Click:Connect(function() print("Clicked") PlayerStats.Value = PlayerStats.Value + Amount end)
I want to make so i can change how much players will get pr click like when you buy something in a shop.
Pls consider helpinh thx :)

2 comments
Note: Select the part of the text that's your code and then click the lua button ( You can edit this question by clicking on the button right under the comments )
But i want the value only to change at the Client not the Server