So in my shop gui I want to have only 1 function that fire every time I click any of the purchase buttons. In the purchase button script it will check its parent's name and send that to the server but I don't actually know how to do this
I tried doing this but obviously it doesn't work.
In the purchase localscript:
script.Parent.MouseButton1Down:Connect(function()
local Price = 20
game.ReplicatedStorage.PurchaseApple:FireServer(Price)
end)
In the ServerScriptService
game.ReplicatedStorage.PurchaseApple.OnServerEvent:Connect(function(Price)
print(Price)
end)
Instead it just prints the playername

1 comment
correct.