local Result = xpcall(broadcastMessage(Type, Message, ply),function(Error) return end)
saveError(Result)
I added few errors inside broadcastMessage for debug.
Doesn't seem to work:
sv: SFtarfall/ENCOM_mainframe.txt:98: bad key to string index (number expected, got string)
sv: SFtarfall/ENCOM_mainframe.txt:105: attempt to index global 'cht' (a nil value)
тѕсм.Person8880 hovers the nerf bat over Tetryon damage
You're calling broadcastMessage, which returns presumably nothing, which means you then pass nil to xpcall.
xpcall then calls nil because that's what the function call returned.
This is what it should be:
local function ErrorHandler( Error )
print( "Oh noes! An error:", Error )
end
local Result = xpcall( broadcastMessage, ErrorHandler, Type, Message, ply )
(14-02-2015, 04:48 PM)Person8880 Wrote: You're calling broadcastMessage, which returns presumably nothing, which means you then pass nil to xpcall.
xpcall then calls nil because that's what the function call returned.
This is what it should be:
local function ErrorHandler( Error )
print( "Oh noes! An error:", Error )
end
local Result = xpcall( broadcastMessage, ErrorHandler, Type, Message, ply )
Can you see why yours didn't work now?
Should my line crash the whole chip?
тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Of course, xpcall can't catch something before it's even received its arguments.
You called broadcastMessage(), and it errored.
Note the difference. xpcall takes a function, you performed a function call whose result was passed to xpcall (or in this case, the function errored before it even got that far).
(14-02-2015, 04:53 PM)Person8880 Wrote: Of course, xpcall can't catch something before it's even received its arguments.
You called broadcastMessage(), and it errored.
Note the difference. xpcall takes a function, you performed a function call whose result was passed to xpcall (or in this case, the function errored before it even got that far).
Then I didn't really understund how this function works. Thanks I will try this.
тѕсм.Person8880 hovers the nerf bat over Tetryon damage