Hello, I'm Making a JoJo game and I stumbled upon a little error in my script: OnServerInvoke is not a valid member of RemoteEvent. I'm using a RemoteFunction but it does this error, I really don't understand what's the problem.
local ArrowEvent = game:GetService("ReplicatedStorage").Logic.arrowevent ArrowEvent.OnServerInvoke = function(Player,Arrow,Character,action,hitpos) -- My Code end
This is a server script.
Proof that it's in the right spot: https://imgur.com/a/DPOFU5N
Help Would Be Really Appreciated
Remote events use .OnServerEvent ArrowEvent.OnServerEvent:Connect(function(Parameters) --Your code end)
Use :Connect, not an assignment operator for a RemoteEvent.
Here is the fixed code:
local ArrowEvent = game:GetService("ReplicatedStorage").Logic.arrowevent ArrowEvent.OnServerInvoke:Connect(function(Player,Arrow,Character,action,hitpos) -- My Code end)
I hope this helps!
Maybe the script loaded before the RemoteFunction so, at that time it didn't exist.
local ArrowEvent = game:GetService("ReplicatedStorage").WaitForChild:("Logic").arrowevent ArrowEvent.OnServerInvoke = function(Player,Arrow,Character,action,hitpos) -- My Code end