• Scripted entity isnot working
    5 replies, posted
hi all im making an rp gamemode similar to stranded and im making a banana food sent. my gamemode is derived from base and i hav copied across base_gmod_entity to my entities folder as well as food_banana this is the code cl_init [lua] include( 'shared.lua' ) function ENT:Draw() self.Entity:DrawModel() end [/lua] init [lua] AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( 'shared.lua' ) function ENT:Initialize() self.Entity:SetModel( "models/props/cs_italy/bananna.mdl" ) 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 end function ENT:Use( pl, caller ) local Heal = 20 if pl:Health() + Heal > 100 then Heal = 100 - pl:Health() end pl:SetHealth( pl:Health() + Heal ) end [/lua] shared [lua] ENT.Type = "anim" ENT.Base = "base_gmodentity" ENT.PrintName = "Banana" ENT.Author = "Jason [/lua] anyone got any ideas the banana spawns but i cant move it, cant use it, and its sort of stuck in the ground with no physics :3:
Check console for errors 1st. Reason I say that is because I am unable to find whats wrong just from looking at it...if only I was some sort of lua super proof-reader.
therrer are no errors!
Do you have CS:S?
[lua]ENT.Author = "Jason [/lua] You forgot an "?
if it was the case, it would give him an unfinished string error
Sorry, you need to Log In to post a reply to this thread.