Super new to doing lua stuff with Gmod, and have been trying to make my own basic entity, following this tutorial:
https://www.youtube.com/watch?v=uE5A4AwwIK8&list=PLyQg3m0a5UivaAXEfVDngKYp9jyNSTIo_&index=13
I've followed it through as closely as possible, and am at the stage now where the entity appears in my spawn menu, but nothing happens when I click to spawn it in.
I figured it might have something to do with the fact that the models folder doesn't appear anymore in the GMod folder structure, so I created the models folder and imported a model in there and pointed the script to that instead, but still no luck. I've included the script below, can anyone take a look and see where I'm going wrong?
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
self:SetModel( "models/1x1floor01.mdl" )
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if phys:IsValid() then
phys:Wake()
end
end
Thanks!
Can´t really see anything on the code you showed. How about showing shared.lua and cl_init.lua too?
Here's the shared.lua:
ENT.Type = "anim"
ENT.Base = "Base_gmodentity"
ENT.PrintName = "Test Entity"
ENT.Spawnable = true
and here's my cl_init.lua:
yep, would have told you that if i would have shown up before you fixed it. But yea. Typos are the worst. you barely see them XD
Sorry, you need to Log In to post a reply to this thread.