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

Help me with this RemoteEvent function ?

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

✓ Accepted answer

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)

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

1 comment

0

There is a better and more direct way of doing this.

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