Create sticky_slam.txt

This commit is contained in:
Niko 2025-05-11 15:05:45 +03:00 committed by GitHub
parent 229e14ae72
commit c08d815891
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

18
sticky_slam.txt Normal file
View file

@ -0,0 +1,18 @@
--@name sticky_slam
--@author Niko
--@server
hook.add("OnEntityCreated", "", function(ent)
if ent and ent:isValid() then
if ent:getOwner() == owner() and ent:getClass() == "npc_satchel" then
ent:addCollisionListener(function(colData,collider)
ent:setAngles((colData.HitNormal):getAngle()-Angle(90,0,0))
ent:setFrozen(true)
if colData.HitEntity and colData.HitEntity:isValid() then
ent:setParent(colData.HitEntity)
end
end)
end
end
end)