local function ReturnSomething() return 'Hi' end local S,E = pcall(function() ReturnSomething() end) print(S,E)
this prints (true , nil)
for some reason
I cant get a function to return something to a pcall
I want E to return Hi not nil how do i do this
You need to return it in the actual pcall() callback, instead of in your function.
ie:
local S, E = pcall(function() return "Hi" end print(S, E)
true, Hi
local function returnSomething() return "Hi" end local S, E = pcall(function() return returnSomething() end) print(S, E)
true, Hi