Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I create a button to give cash?

Asked by 7 years ago

i did the script but wont work ingame just in studio

Button = script.Parent.TextButton
Player = game.Players.LocalPlayer
Button.MouseButton1Down:connect(function()
    Player.leaderstats.Money.Value = Player.leaderstats.Money.Value + 10
end)

1 answer

Log in to vote
0
Answered by 7 years ago
Edited by M39a9am3R 7 years ago
local Button = script.Parent:WaitForChild('TextButton')
local Player = game.Players.LocalPlayer
local leader = Player:WaitForChild('leaderstats')
local Money = leader:WaitForChild('Money')

Button.MouseButton1Down:connect(function()
    Money.Value = Money.Value + 10
end)

0
thx so much :) ItzAngelXz 0 — 7y
0
Edited for code block. Please provide explanation with your answers. M39a9am3R 3210 — 7y
Ad

Answer this question