First lets learn what remote events are remote events are basically, events which you can only access from server to client or client to server.
To learn more visit:https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events
Some actions can only be performed by a server and other actions only by a client. For example, a player (client) may activate a GUI button, upon which the server needs to enact a game-wide change. In these cases, a RemoteEvent or RemoteFunction lets server-side Scripts and client-side LocalScripts communicate with each other.
THIS Basically means that you can call an event from a local script to a server using the :InvokeServer remember this must be in a localscript
When using a inbuilt function Like :InvokeServer or :FireServer you must connect it to a remote event like this
Make sure this is in a localscript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEventTest")
local clientPart = Instance.new("Part")
clientPart.Parent = workspace
remoteEvent:FireServer(clientPart)
Secondly, you must make sure you have a listener this is so the server knows that you want to make a request
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, argument)
end)
2 comments
Do you have the remote event in the replicated storage?
i don't think there's a way to check if a specific remote has been fired, but if you want to reduce the times a remote can be fired with debounce