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

Why is this remote function outputting an error?

:For some reason, this basic remote function script isn't working and I'm not quite sure why. Anything wrong with my scripts?

:Function Script:

script.ClickButton.OnServerInvoke = function()
	print('Its Working!')
end

:Call Function Script:

a = 1
for i=1, 5 do
	print(a)
	a = a + 1
	wait(1)
end
script.Parent.ButtonScript.ClickButton:InvokeClient()

:Error Code:

08:50:56.079 - Argument 1 missing or nil 08:50:56.080 - Stack Begin 08:50:56.080 - Script 'Workspace.NoteTrack.Buttons.ButtonA.Script', Line 7 08:50:56.081 - Stack End

1 answer

✓ Accepted answer

InvokeClient requires one argument, a player object. I'm not entirely sure what you're doing over there, but I believe you meant OnClientInvoke in the function script. If you are not communicating between a ServerScript and a LocalScript, you could simply use a BindableFunction

1 comment

0

It suggested I use "InvokeClient", and I'm not quite sure why, I switched it to InvokeServer and it fixed the problem, thanks!

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