raid6n
(Raiden)
September 20, 2020, 6:26pm
#1
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
xZylter
(xZylter)
September 20, 2020, 6:30pm
#2
Try using this on the server instead.
local function Function()
local String = "Hello"
return String
end
1 Like
raid6n
(Raiden)
September 20, 2020, 6:32pm
#3
i got the same error how can I fix
raid6n
(Raiden)
September 20, 2020, 6:38pm
#4
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
raid6n
(Raiden)
September 20, 2020, 7:03pm
#6
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.
raid6n
(Raiden)
September 20, 2020, 7:04pm
#8
oh you’re saying that was the orginal problem?
Yep. Get rid of the parentheses at the end of this line.
raid6n
(Raiden)
September 20, 2020, 7:07pm
#10
ah, thanks, i was a little lost after finding a solution