• attempted to call Gettable (a nil value)
    1 replies, posted
Bit confused onto how to fix this or what it means, any and all help is appreciated. (this is a script to freeze cars) [ERROR] lua/autorun/car_freeze.lua:46: attempt to call field 'GetTable' (a nil value)   1. fn - lua/autorun/car_freeze.lua:46    2. unknown - addons/ulib/lua/ulib/shared/hook.lua:109 The first bit of code mentioned in the error 43 hook.Add("PhysgunDrop", "car_freeze_drop", function( ply, ent ) 44 if(!ent:IsPlayer()) then 45 if(ent:GetClass() == 'prop_vehicle_jeep') then 46 for k, v in pairs (constraint.GetTable(ent)) do 47 if(v.Ent2 == game.GetWorld()) then 48 v.Constraint:Remove(); 49 end; 50 end; 51 -- ent:SetMoveType(6) 52 -- local phys = ent:GetPhysicsObject() 53 -- if phys:IsValid() then phys:SetDamping(0, 0) end 54 -- local ConstrainedEnts = constraint.GetAllConstrainedEntities( ent ) 55 -- for _, ent in pairs( ConstrainedEnts ) do 56 -- if(ent.Entity:IsValid()) then 57 -- ent.Entity:SetMoveType(6); 58 -- end; 59 -- end; 60 end; 61 end; 62 end); 2. 92 function Call( name, gm, ... ) 93 94 -- 95 -- Run hooks 96 -- 97 local HookTable = Hooks[ name ] 98 if ( HookTable != nil ) then 99 100 for i=-2, 2 do 101 102 for k, v in pairs( HookTable[ i ] ) do 103 104 if ( v.isstring ) then 105 106 -- 107 -- If it's a string, it's cool 108 -- 109 local a, b, c, d, e, f = v.fn( ... ) 110 if ( a != nil && i > -2 && i < 2 ) then 111 return a, b, c, d, e, f 112 end
car_freeze.lua is a shared file and PhysgunDrop is a shared hook but constraint.GetTable is a serverside function.
Sorry, you need to Log In to post a reply to this thread.