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

In FilteringEnabled how do i make it so it takes the player to the correct spawn?

Asked by 7 years ago
Edited 7 years ago

Why in Filtering Enabled when I respawn a player using;

game.ReplicatedStorage.LoadCharacter:InvokeServer(script.Parent.Parent.Parent)


function game.ReplicatedStorage.LoadCharacter.OnServerInvoke(plr)
    plr:LoadCharacter()
end

It not take them to the correct spawn Location. Please help!

0
Use a RemoteEvent instead. StoIid 364 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Because they have to be in two serperate scripts. The InvokeServer has to be used from client, to call a server, while OnServerInvoke handles the invokes made by server.

LocalScript:

game.ReplicatedStorage.LoadCharacter:InvokeServer(script.Parent.Parent.Parent)

Script(server script):

function game.ReplicatedStorage.LoadCharacter.OnServerInvoke(plr)
    plr:LoadCharacter()
end
Ad

Answer this question