What does :Invoke() mean in this script? Is it a Virus?

Hello I am trying to communicate code between 2 scripts.
in order to do this I am using a BINDABLE FUNCTION

Here is my first script which requests information

local empire = game.ReplicatedStorage.Coalition.Function:Invoke()
print(empire) -- PRINTS NIL

Here is my second script which sends it

game.ReplicatedStorage.Coalition.Function.OnInvoke = function()
	return "Worked"
end

unfortunately it does not work. such vile discrace that roblox rejects my script. It outputs
nil
for the “print(Empire)”

Indeed such vile idiocy and asininity. They should learn to heed to thy supreme power.

It’s not a virus. You’re safe. BindableFunctions are used to communicate between scripts. BindableFunction | Roblox Creator Documentation

1 Like

The way I was doing the code was correct. I thought I was doing something wrong as the API is giving false information and saying that :Fire() exists when in reality it’s :Invoke(). the issue wasnt the method I was calling and returning information but I messed my parameters up however I got it working by debugging the parameters. Roblox really needs to fix that api because its saying a bunch of false information

That would be with BindableEvents where you create a Event, and fire it using BindableEvent:Fire(), but for this you are using a BindableFunction, you Invoke a function to Execute its code.

The More You know

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.