I’ve got a part which on clicked is meant to activate a function from another script
How do I achieve this with remote events?
When the part is clicked, it fires the events and when the event is fired the other script detects it and calls a function (both non-local scripts)
can someone gimme some help?
edit: oh wait forgot to mention that i need it to fire multiple functions
You don’t have to use remote-events. You can use basic bindable-events. They allow you to send signals between scripts. Local, non-local, whatever.
Here’s an example.
forgot to mention i need it to fire multiple functions from different scripts, correct me if im wrong but im not sure they can
They can. Here’s an example.
-- Main script firing the event.
BindableEvent:Fire("ok")
-- Script 1.
BindableEvent:Connect(function(Argument)
print(tostring(Argument)) -- Prints out 'ok'
end)
-- Script 2.
BindableEvent:Connect(function(Argument)
warn(tostring(Argument)) -- Will warn you 'ok'
end)