local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage.RemoteEvents
local BuyItem = RemoteEvents.BuyItem
local Buy = player.PlayerGui:WaitForChild("Gui").Main.Info.Buy
Buy.MouseButton1Click:Connect(function()
BuyItem:FireServer()
print("Buy")
end)
COMMUNITY QUESTION
Why is it not FiringServer when the player clicks on the "Buy" button?
1 answer
local event = game:GetService("ReplicatedStorage").RemoteEvents.BuyItem
function leftClick(mouse)
event:FireServer()
print(game.Players.LocalPlayer.Name.." Clicked Buy")
script.Parent.MouseButton1Click:connect(leftClick)
This discussion is preserved as it was. New answers, comments, and votes are closed.
