Hi I’m kinda new to coding and I have a question.
Is there a way to call one function in a local script from another local script? Note I am not talking about module scripts.
Hi I’m kinda new to coding and I have a question.
Is there a way to call one function in a local script from another local script? Note I am not talking about module scripts.
Yes, you can use BindableEvents or BindableFunctions to achieve that.
For example:
local1
local f = game.ReplicatedStorage.Function
f:Invoke("hi")
local2
local f = game.ReplicatedStorage.Function
f.OnInvoke = function(msg)
print(msg)
end
Setup
Output
YES! Thank you so much, I was about to make my inventory system so complicated with a module script interconnecting the pick up script and the inventory script. Thank you!