Ulysses
General => Developers Corner => Topic started by: Neoon on February 22, 2014, 01:36:37 PM
-
HI there :D
I just create a little teleport script and seems like ULX is blocking/removing the hook?
local comodo_spawn_pos = Vector(-944.464111, -196.986008, -15775.968750)
local function skybox( ply, text, public )
if (string.sub(text, 1, 6) == "/skybox") then
ply:SetPos(comodo_spawn_pos)
return ""
end
end
hook.Add( "PlayerSay", "skybox", skybox );
Thats what i get:
22:35:49 Running script autorun/teleport.lua...
Loading Teleport script
TEST [lua/autorun/lordi_anti_propkill.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/m9k_assault_rifles.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/m9k_heavy_weaps.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/m9k_small_arm_weapons.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/m9k_specialties.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/pdmg_client.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/pdmg_convars.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/pdmg_exclusions.lua][lua/autorun/teleport.lua]
TEST [lua/autorun/pdmg_server.lua][lua/autorun/teleport.lua]
[ERROR] lua/includes/util.lua:184: attempt to index local 'object' (a number value)
1. IsValid - lua/includes/util.lua:184
2. sortHooks - addons/ulib/lua/ulib/shared/hook.lua:47
3. Add - addons/ulib/lua/ulib/shared/hook.lua:105
4. unknown - lua/autorun/teleport.lua:10
Any idea? http://facepunch.com/showthread.php?t=1367997 (http://facepunch.com/showthread.php?t=1367997) I hope you can help me here more...
-
Odd. It's saying that the hook name (which should be a string) is a number. Though, the ULib hook library is built to be the same as Garry's, so you'd have the same issue without ULib.
-
Wait, "skybox" is a string not a number.
-
Is this part of a bigger file? It says "unknown - lua/autorun/teleport.lua:10" but there's only 9 lines. Also, what map is this on?
-
Perhaps it is your pmdg files.