• Small Mixed LUA problems
    6 replies, posted
having some problems with my SWEP. heres the errors and the function in that line: Error: [lua]addons\c4 pack swep\lua\entities\rp_bomb\init.lua:47: function arguments expected near 'end' function ENT:Initialize() self.Entity:SetModel(Model) self.Entity:PhysicsInit(SOLID_VPHYSICS) self.Entity:SetMoveType(MOVETYPE_VPHYSICS) self.Entity:SetSolid(SOLID_VPHYSICS) local phys = self.Entity:GetPhysicsObject() if phys:IsValid() then phys:Wake() end self.Position = Vector() self.Activated = false self.Exploding = false self.IsTNT = true self.Integrity = 20 timer.Create( "Bomb_Timer", 30, 1, function() self:Detonate end) -- apparently this is line 47. whats wrong here? end [/lua] next problem. i get this error: Folder = entities/rp_bomb Couldn't register Scripted Entity rp_bomb - the Type field is empty! even though in my shared i have this: ENT.Type = "anim" what gives here? please tell me whats wrong!
self:Detonate should be self:Detonate() Thats if ENT:Detonate even exists.
I think the type field thing is just something you get when there was a syntax error in the code. You're including shared in init and cl_init, right?
[QUOTE=MegaJohnny;24374530]I think the type field thing is just something you get when there was a syntax error in the code. You're including shared in init and cl_init, right?[/QUOTE] there is no init and CL_init. i managed to pack it into one shared.
[QUOTE=Kruel Kramer;24374879]there is no init and CL_init. i managed to pack it into one shared.[/QUOTE] That works too. Syntax errors are the cause.
okay fixed and testing...
Sorry, you need to Log In to post a reply to this thread.