Invoke is not a valid member of RBXScriptSignal

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.

directory

1 Like

core.RequestLock is not a BindableFunction, it’s an event. Where did you define it?

Replace OnInvoke with OnClientInvoke in the LocalScript?

I should’ve been more clear on the directories.

local core = script.Parent.Parent;

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.

Can you try print(core.RequestLock)

Okay, so it definitely is interpreting it in the engine as a signal. (Printed core.RequestLock)
Screenshot 2023-04-09 135959

But in the script editor when I go to the directory manually it says
hrtyhrtyhrtyhhrtyh

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);

What happened when you used WaitForChild?

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!

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