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

Why is my bindable function stopping my script?

hey all.

im trying to send data between two server scripts, and to that end im trying to use a bindable function that invokes the data i want to send on one end, and basically just grabs and saves it on the other.

something sort of like this:

relevant code in script with data

local ServerStorage = game:GetService("ServerStorage")
local bf = ServerStorage.DataPasser
bf:Invoke(transferid,transferplayer,ModifiableStatsDictionary)

relevant code in script that wants the data

bf.OnInvoke = function (transferid,transferplayer,ModifiableStatsDictionary)
	local localid = script.Parent.Name
	if transferid == localid then
		player = transferplayer
		StoredStatsDictionary = ModifiableStatsDictionary
	end
end

the problem im having is that the script that sends the data comes to the invoke line, and just stops. it doesnt throw an error or anything, the script just halts there and doesnt execute anything from that point forward. and from what i can tell, the second script doesnt do anything either.

have i writen something wrong? is it the way im checking for the correct id before saving the data? any input would be appreciated.

1 answer

✓ Accepted answer

With Bindable/Remote functions, you always need a return, whether it returns something or nothing.

2 comments

0

^ This ^

0

event when the function has a return, nothing happens. the function never even seems to start running.

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