[CODE] local ent = ents.Create('prop_dynamic') [/CODE]
Any idea why this crashes my server when I attempt this? It used to work for me in an old script I made but now it no longer works. My server doesn't give an error it just crashes and burns into an apocalyptic hell.
Full Code:
[CODE]
local ent = ents.Create('prop_dynamic')
print("Printed ent")
if ((ent:GetClass() == "prop_dynamic") or (ent:GetClass() == "prop_physics")) then
print("In the conditional")
ent:SetSolid( SOLID_VPHYSICS )
print("Set Physics")
ent:SetMoveType( MOVETYPE_NONE )
print("SetMoveType")
end
ent:SetModel(v.model)
print("Set Model")
ent:SetPos(v.pos)
print("Set Pos")
ent:SetAngles(v.angle)
print("Set Angle")
ent:Spawn()
print("Spawn")
local entphys = ent:GetPhysicsObject();
if entphys:IsValid() then
entphys:EnableGravity(false);
entphys:Wake();
end
[/CODE]
It errors out at the entity creation I have already verified that with all those debugging prints and stuff.
FIXED: You apparently can't create a dynamic prop on the map in a function when called by sv_hooks.lua
Sorry, you need to Log In to post a reply to this thread.