Bindable Function doesnt print Hello

im bad at coding

--Script One

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

--Script Two

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

output:
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
end
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"
end

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