So, I know the basics of them like how to make them spawnable and how to set there model but, i have tried and tried to teach my self about entities work, but i dont know how. And i want to make a entity with a suitcase model wich when 'consumed' like DarkRP Food it changes the player model to a suit. -
Thanks!
All entities by default have a set of default functions which can be called under certain circumstances, ENT:Think is hopefully familiar to you, ENT:Use, like ENT:Think is default.
You still have to write the function for it though,
[CODE]function ENT:Use( pl )
if !(pl:GetModel() == self.m_sModel) then
pl:SetModel(self.m_sModel)
self:Remove()
end
end[/CODE]
That code above makes it so that when a player presses E on the entity, it sets the player's model to self.m_sModel (which should be defined at the top of the code as ENT.m_sModel = <model name>) and removes the briefcase entity.
Sorry, you need to Log In to post a reply to this thread.