Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

RemoteFunction not receiving on the server?

Asked by 3 years ago

My RemoteFunction does not receive on the server after I invoke it.

Here is the LocalScript code:

local Move = Events["Move"]:InvokeServer(Part.Parent:FindFirstChild("ReferencePart"))

I know it gets past the Move variable because it prints nil

Here is the Script code:

Events["Move"].OnServerInvoke = function(Player, Part)
    local Tween = TS:Create(Player.Character.HumanoidRootPart, TweenInfo.new(0.5), {CFrame = Part.CFrame})
    Tween:Play()
    Tween.Completed:Wait()
    return true
end

It doesn't receive at all, I've tried putting it in a blank script, but it still wouldn't work.

Any help will be highly appreciated!

1 answer

Log in to vote
0
Answered by
orcazate 170
3 years ago
Edited 3 years ago

Hey ColeRandom,

Have you tried running connect when you check for an Invoke?

-- Here is a potential server script code I have assembled for you

Events["Move"].OnServerInvoke:Connect(function(Player, Part)
    local Tween = TS:Create(Player.Character.HumanoidRootPart, TweenInfo.new(0.5), {CFrame = Part.CFrame})
    Tween:Play()
    Tween.Completed:Wait()
    return true
end)

Also, is Events defined?

If you have any issues with either of these scripts don't hesitate to ask.

Cheers, Orcazate

Ad

Answer this question