diff --git a/lua/wire/gates/entity.lua b/lua/wire/gates/entity.lua index b5c086d603..17fa0d5a11 100644 --- a/lua/wire/gates/entity.lua +++ b/lua/wire/gates/entity.lua @@ -1236,4 +1236,38 @@ GateActions["entity_eyepos"] = { end } +GateActions["entity_setanglevelocity"] = { + name = "Set Angle Velocity", + inputs = { "Ent", "Vec" }, + inputtypes = { "ENTITY", "VECTOR" }, + timed = true, + output = function(gate, ent, vec) + if not isAllowed(gate, ent) then return end + local phys = ent:GetPhysicsObject() + if not IsValid(phys) then return end + vec = clamp(Vector(vec.x, vec.y, vec.z)) + phys:SetAngleVelocity(vec) + end, + label = function(_, ent, vec) + return string.format("(%s):setAngleVelocity(%s)", ent, vec) + end +} + +GateActions["entity_setvelocity"] = { + name = "Set Velocity", + inputs = { "Ent", "Vec" }, + inputtypes = { "ENTITY", "VECTOR" }, + timed = true, + output = function(gate, ent, vec) + if not isAllowed(gate, ent) then return end + local phys = ent:GetPhysicsObject() + if not IsValid(phys) then return end + vec = clamp(vec) + phys:SetVelocity(vec) + end, + label = function(_, ent, vec) + return string.format("(%s):setVelocity(%s)", ent, vec) + end +} + GateActions()