So I've spawned an entity, and I can't undo it without getting this error:
[i]:1: attempt to call method 'OnUndo' (a nil value)[/i]
Hmm. Here's my code, and if anybody could point at me
the newbie mistake I'm making, well...that'd just make my day.
[code]
barrel = ents.Create("prop_physics")
barrel:SetModel("models/props_c17/oildrum001.mdl")
barrel:SetPos( ply:GetEyeTrace().HitPos + ply:GetAimVector() )
barrel:Spawn()
undo.Create("Barrel")
undo.AddEntity( barrel )
undo.SetPlayer( ply )
undo.Finish()
[/code]
Thanks to you gentlemen who kindly tolerate newbie questions.
Sorry, you need to Log In to post a reply to this thread.