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

Help me with this RemoteEvent function ?

Asked by
14dark14 167
4 years ago

Ok so Is there any way I can fire a RemoteEvent from a local script

game.ReplicatedStorage.RemoteEvent:FireServer()

and make another local script run using that remote

game.ReplicatedStorage.StartTimer.OnClientEvent:Connect(function()

both scripts are local and It obviously doesn't work, I just want to know if there is a diffrent way of doing this maybe? To give more context - I have a local script in StarterGui that can be run using RemoteEvent, but the only option I have is to use another local script to run that script.

2 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

If you want to do this, use a BindableEvent. A BindableEvent is basically a remote event, but instead of server to client or visa versa, its client to client/server to server,

script A:


game.ReplicatedStorage.BindableEvent:Fire()

script B:

game.ReplicatedStorage.BindableEvent.Event:Connect(function()

end)
Ad
Log in to vote
0
Answered by 4 years ago

if you really want it to be in that way then you do it like this you dont need to touch the local script that fires the server in in a server script you do this

event.OnServerEvent:Connect(function(player)
    otherevent:FireClient(player)--give the path to the other remoteevent
end)

and then your other local script looks pretty good to go

0
There is a better and more direct way of doing this. DeveloperSolo 370 — 4y

Answer this question