still pushues u around so i wonder if there's a way to fix that



Code: Select all
---@type Plugin
local plugin = ...
plugin.name = 'godmoder'
plugin.author = 'starfounder:333333'
plugin.description = 'tf'
plugin.commands['/godmoder'] = {
info = 'become super silly',
canCall = function (ply) return ply.isAdmin end,
---@param ply Player
call = function (ply)
if ply.human.data.invin ~= 1 then
ply:sendMessage("noDie enabled")
ply.human.data.invin = 1
elseif ply.human.data.invin == 1 then
ply:sendMessage("noDie disabled")
ply.human.data.invin = 0
end
end
}
-- You'll still get pushed, but falls, cars, and explosions won't kill you. Bullets too!
plugin:addHook('Logic', function()
for i, ply in ipairs(players.getAll()) do
if ply.human and ply.human.data.invin == 1 then
ply.human.isAlive = true
ply.human.isBleeding = false
ply.human.health = 100
ply.human.chestHP = 100
ply.human.leftArmHP = 100
ply.human.rightArmHP = 100
ply.human.leftLegHP = 100
ply.human.rightLegHP = 100
ply.human.bloodLevel = 100
end
end
end)