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

Why can't my script read that i have called a remote event?

Asked by 5 years ago

this is my receiving script:

local TeleportService = game:GetService("TeleportService")

local onevone = 2042766539

game.ReplicatedStorage.SendToGame.OnServerEvent:connect(function(mode,player1,player2)
    if mode == "onevone" then
    TeleportService:TeleportPartyAsync(onevone, {player1, player2})
    end
end)

when i do game.ReplicatedStorage.SendToGame:FireAllClients() it doesn't receive it

1 answer

Log in to vote
1
Answered by
amanda 1059 Moderation Voter
5 years ago

The OnServerEvent event is triggered by calling the FireServer method of the same RemoteEvent.

The snippet of your clientside code which does this should be similar to the following:

game.ReplicatedStorage.SendToGame:FireServer(player1, player2)

Let me know on here or discord if you have questions.

amanda

Ad

Answer this question