So I get this annoying error "FireEvent is not a valid member of RemoteEvent" How I can fix??

local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:FindFirstChild("ButtonClick")

local button = script.Parent

local debounce = false

button.MouseButton1Click:Connect(function()
	if not debounce then
		debounce = true
		local playerPoints = game.Players.LocalPlayer.leaderstats.Yes
		remote:FireEvent(playerPoints)
		wait(1)
		debounce = false
	end
end)

5 comments

1

Change FireEvent to FireServer

0

Where are you firing it to? Are you on a LocalScript or a Script?

0

I am using a localscript

0

If you are using a local script then use :FireServer()