How do i make the button look like it was pressed? I searched & all i could find was derma stuff. i also looked here garrysmod/gmod_button.lua at master · Facepunch/garrysmod · GitH.. but i don't see how.
function ENT:Initialize()
self:SetModel("models/maxofs2d/button_02.mdl")
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
self:SetCollisionGroup( COLLISION_GROUP_WEAPON )
end
function ENT:Use( ply )
--
ply:Give("weapon_crowbar")
end
I just googled this like 2-3 days ago and also didnt find anything xd.
The way I do it is by using SetPoseParameter
This only works if your ent has a poseparameter for it being pushed in and out.
if buttonpressed then
ent:SetPoseParameter("button_press", 1)
else
ent:SetPoseParameter("button_press", 0)
end
Wow i actually thiught that was for just the lever buttons XD, Thanks!
Sorry, you need to Log In to post a reply to this thread.