Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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!

1 comment

0

Use a RemoteEvent instead.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.