Im doing LUA and i made a entity but the entity is just a shadow please help!
9 replies, posted
here is the code if you need to see it
init.lua
include("shared.lua")
function ENT:Draw()
slef:DrawModel()
end
shared.lua
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "TestEntity"
ENT.Spawnable = true
[del]Try asking the people in [URL="https://facepunch.com/forumdisplay.php?f=65"]this section (hyperlinked)[/URL][/del]
Also, you should format your code with [noparse][code]<code goes here>[/code][/noparse] tags
slef:DrawModel()
to
self:DrawModel()
nothing you said works also you spelled self wrong so dont forget i have no idea what your saying
[QUOTE=CarlTheLoafLo;51936223]nothing you said works also you spelled self wrong so dont forget i have no idea what your saying[/QUOTE]
[IMG]http://i.imgur.com/FirR1c5.png[/IMG]
[highlight](User was banned for this post ("shit post" - Bengley))[/highlight]
Why the big emoji
YOU spelled self wrong in your post..
Bring back bad spelling rating pls
[QUOTE=CarlTheLoafLo;51936223]nothing you said works also you spelled self wrong so dont forget i have no idea what your saying[/QUOTE]
This is it boys, we've reached the [img]https://facepunch.com/fp/ratings/box.png[/img] event horizon. :incredible:
[B]Edit:[/B]
Since I've already been an ass, I guess I can try to help...
1. ENT:Draw() is clientside method. init.lua is run serverside. Put ENT:Draw() in either cl_init.lua or shared.lua.
2. self is misspelled in ENT:Draw().
3. base_gmodentity is a sandbox specific thing. It's for stuff like thrusters and balloons and wiremod chips. This is fine if you're making an entity like that, but it won't exist if you're not running a sandbox derived gamemode. Just something to consider.
4. Neither base_gmodentity, base_anim, nor base_entity set a model by default AFAIK, so you're going to want to do that (serverside/shared!), like in this example stolen from the old wiki:
[code]
function ENT:Initialize()
self:SetModel("models/props_c17/oildrum001.mdl")
end
[/code]
4B. If you want physics to work you're going to have to call some more functions in ENT:Initialize(), just look how other people do it.
5. In most cases it's less of a headache to just use a single lua file per entity and use "if SERVER then" / "if CLIENT then" kind of stuff.
Sorry, you need to Log In to post a reply to this thread.