Bindable Function doesnt print Hello

im bad at coding

--Script One

local Hello = game.ReplicatedStorage:WaitForChild("Events/Functions"):WaitForChild("Print"):Invoke()

--Script Two

local function Function()
	return "Hello"
game.ReplicatedStorage:WaitForChild("Events/Functions"):WaitForChild("Print").OnInvoke = Function()

14:19:56.036 - attempt to call a string value

how can I fix it? thanks

Try using this on the server instead.

local function Function()
	local String = "Hello"
    return String
1 Like

i got the same error how can I fix

yeah, idk how this works and the other script doesnt, but like here what i ddiL

game.ReplicatedStorage:WaitForChild("Events/Functions"):WaitForChild("Claim").OnInvoke = function()
	return "Hello"

Get rid of the parentheses, you don’t want to call the function.
.OnInvoke = Function

it still works even if i call the function, is there a reason why your way is better

But you said it didn’t work when you called the function. I am referring to the original post.

oh you’re saying that was the orginal problem?

Yep. Get rid of the parentheses at the end of this line.

ah, thanks, i was a little lost after finding a solution