I created a text button and put the script to when press it gives random coins to 1 to 100 coins
math.randomseed(tick())
local random = math.random(1,100)
function OnClick(Plr)
script.Disabled = true
if Random >= 1 or Random <= 50 then
local Stats = Plr:WaitForChild("Stats").Coins
Stats.Value = Stats.Value math.random(1,100)
elseif Random >= 51 or Random <= 100 then
local Stats = Plr:WaitForChild("Stats").Coins
Stats.Value = Stats.Value math.random(1,100)
end
end

8 comments
i wanted whenever a player clicks text button it gives them random coins from 1 to 100
Also im not sure why you disabled the script, if you do need to disable the script you should put script.Disabled at the end (inside the function)
I've changed the script a bit so tell me if it's still not what you wanted
didn't work i've tried
You're sure you modified the script so it works with your button ?
yeah
Well then the error come from your script, caus i tested mine from line 3 and it works
maybe its because of the function the output says Players.mastercheeseit.PlayerGui.Gui.Settings.List.Frame.TextButton.LocalScript:2: Incomplete statement: expected assignment or a function call