Hi everyone, for lua understanding purposes I've been working on a NPC, which works as I want, but I have one problem, which is the following :
When I spawn it with serverside lua, and try to modify its appearance and its Owner, the NPC won't change its model, and still be considered " world " when I pute my laserbeam on it.
Why is that ? Is there a way to change / overwrite those datas ?
net.Receive("deploy140test",function(len,ply)
local robottest = ents.Create( "npc_douglasrobot" )
if ( !IsValid( robottest ) ) then return end
robottest:SetPos(ply:GetPos()+Vector(50, 0,5 ))
robottest:Spawn()
robottest:SetModel( "models/Humans/Group01/Female_04.mdl" )
robottest:SetOwner(ply)
end)
Thanks for taking the time to help, R.
Call robottest:Spawn() after you set the model, and try robottest:CPPISetOwner( ply ) instead of SetOwner
Thank you for the answer !
The CPPISetOwner works perfectly !
Unfortunately, the model won't change, I think I would have to create different versions of the NPC, if someone has a better idea I would be glad to hear it
Sorry, you need to Log In to post a reply to this thread.