I don’t know why, but my BindableFunction is erroring. I’ve quadruple sanity checked the wiki page and even basically replicated the wiki only to keep getting an error. Is there an oversight somewhere?
Sending
if input.UserInputType == Enum.UserInputType.MouseButton1 and not gameProcessedEvent then
local fetchLock = core.RequestLock:Invoke(); --Error line
if fetchLock then
end
end
and the recipient
local lock = script.Parent:WaitForChild("RequestLock");
lock.OnInvoke = function(...)
return selection; --Selection is a variable representing either nil or a Model
end
Red - sending
Blue - recipient
Green - bindablefunction
Both are LocalScripts, the ultimate parent of all of these is the player’s Character.
The core is the parent of the Self LocalScript. I defined fetchLock (intended to be the returned value) as core.RequestLock and then called :Invoke(). I tried to use :WaitForChild() earlier to solve it and it didn’t work.
RequestLock is on the same directory as the Self LocalScript.
Okay, so it definitely is interpreting it in the engine as a signal. (Printed core.RequestLock)
But in the script editor when I go to the directory manually it says
Edit : Note that the variable is never changed once within the script.
Here are the three times it is used,
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.MouseButton1 and not gameProcessedEvent then
local fetchLock = core.RequestLock:Invoke();
if fetchLock then
if cd.Value <= cd.MinValue then
fire:FireServer(chr.PrimaryPart.CFrame, fetchLock);
end;
end;
end;
end);
Turns out I only used WaitForChild on one of the scripts out of the two. RequestLock must have been some sort of ROBLOX event that isn’t named anywhere. Thank you!