Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is it not FiringServer when the player clicks on the "Buy" button?

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)

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.