there is a button on jb_new_summer_v2 that will open the cell doors when shot. I want to be able to check if the button was shot then print something in the console after it is shot. Here's what I have so far, but I have no idea how to check the button's input:
hook.Add( "Think", "Another unique name", function(ply)
for k,v in pairs(ents.GetAll()) do
if v:GetName() == "cellopen" then
end
end
end )
I tried using Entity:GetKeyValues() to find something but I couldn't find anything.
Use GM:AcceptInput
I'm trying this but it's still not working. It will print out that the button was pressed when a player presses e on it , but not when it's shot.
hook.Add( "AcceptInput", "BlockLuaRun", function( ent, name, activator, caller, data )
if ( ent:GetClass() == "func_button" ) then
print("The button was pressed")
end
end )
Try PlayerUse maybe? Not sure if shooting calls it.
Not sure if EntityTakeDamage will work, but you could give it a try
Sorry, you need to Log In to post a reply to this thread.