I have a vending machine that dispenses 4 types of chips, each type of chips corresponds to a different button on the machine.
function GiveChips1()
--code to give chips to the player who clicked the button
script.Parent.Button1.ClickDetector.MouseClick:connect(GiveChips1)
function GiveChips2()
--code to give chips to the player who clicked the button
script.Parent.Button2.ClickDetector.MouseClick:connect(GiveChips2)
function GiveChips3()
--code to give chips to the player who clicked the button
script.Parent.Button3.ClickDetector.MouseClick:connect(GiveChips3)
function GiveChips4()
--code to give chips to the player who clicked the button
script.Parent.Button4.ClickDetector.MouseClick:connect(GiveChips4)
end
end
end
end
I have this part of the script done, the part that detects the click and binds it to a function GiveChips. But how do I make it so that GiveChips gives the chips to the player who clicked the button?

2 comments
Thanks
np