-- thanks therealscroob! -- made by Zilloy function CopyCatRevolverPerfect(damage, activator, caller) local isCritBot = 0 local getCallClass = caller.m_iClass if getCallClass == 8 or getCallClass == 9 then activator:AcceptInput("$DisplayTextChat", "{Red}Spies and Engineers aren't allowed. Denied.") return end -- local userBulletRes = activator:GetAttributeValue("dmg taken from bullets reduced") or 1 -- local userBlastRes = activator:GetAttributeValue("dmg taken from blast reduced") or 1 -- local userFireRes = activator:GetAttributeValue("dmg taken from fire reduced") or 1 -- local userCritRes = activator:GetAttributeValue("dmg taken from crit reduced") or 1 -- local userMoveSpeed = activator:GetAttributeValue("move speed bonus") or 1 -- local userRegen = activator:GetAttributeValue("health regen") or 0 if caller:InCond(34) and not caller:IsRealPlayer() then isCritBot = 1 end activator.copyItems = {} activator:SwitchClassInPlace(getCallClass) activator:AcceptInput("$DisplayTextChat", "{yellow}You Are Now {blue}"..tostring(caller:GetPlayerName())) activator:AcceptInput("SetCustomModelWithClassAnimations", tostring(caller.m_ModelName)) activator:PlaySound("misc/halloween/spell_teleport.wav") activator:AcceptInput("RunScriptCode","DispatchParticleEffect(`teleported_red`,self.GetOrigin(),Vector(-90, 0, 0))") activator.copyItems = caller:GetAllItems() -- PrintTable(activator.copyItems) timer.Simple(0.22, function() for i, items in pairs(activator.copyItems) do activator:GiveItem(activator.copyItems[i]:GetItemName(), activator.copyItems[i]:GetAllAttributeValues()) end end) timer.Simple(0.1, function() --thanks Wacev for this bit for attr,val in pairs(caller:GetAllAttributeValues()) do --get all attrs and their values from caller / attr = attribute name / val = attribute value -- if attr ~= "hidden maxhealth non buffed" then --don't copy the health of a bot activator:SetAttributeValue(attr, val) print(attr,": ",val) -- end end if caller.m_bIsMiniBoss == 1 then activator.m_flModelScale = 1.7 activator.m_bIsMiniBoss = 1 -- else -- activator.m_flModelScale = caller.activator.m_flModelScale end -- if not caller.IsRealPlayer() then activator:SetAttributeValue("hidden primary max ammo bonus", 10) activator:SetAttributeValue("hidden secondary max ammo penalty", 10) activator:SetAttributeValue("ammo regen", 1) -- end -- activator:SetAttributeValue("dmg taken from bullets reduced", userBulletRes) -- activator:SetAttributeValue("dmg taken from blast reduced", userBlastRes) -- activator:SetAttributeValue("dmg taken from fire reduced", userFireRes) -- activator:SetAttributeValue("dmg taken from crit reduced", userCritRes) -- activator:SetAttributeValue("move speed bonus", userMoveSpeed) -- activator:SetAttributeValue("health regen", userRegen) -- activator:SetAttributeValue("cannot upgrade", 1) if isCritBot == 1 then activator:AddCond(37, 9999, Attacker) end end) -- local classSwapTime = 30 local SwapBackToClass SwapBackToClass = timer.Create(1, function () -- classSwapTime = classSwapTime - 1 -- if classSwapTime <= 5 and classSwapTime > 0 then -- activator:PlaySoundToSelf("weapons/det_pack_timer.wav") -- end -- activator:AcceptInput("$DisplayTextCenter", "Class copy ends in: "..classSwapTime, activator) --revert early if activator:IsValid() == false or getCallClass ~= activator.m_iClass then timer.Stop(SwapBackToClass) end if activator:IsAlive() == false then activator:SwitchClass(8) activator:AcceptInput("SetCustomModelWithClassAnimations", "") classSwapTime = 30 timer.Stop(SwapBackToClass) activator:SetAttributeValue("SET BONUS: move speed set bonus", nil) -- activator:SetAttributeValue("dmg from ranged reduced", nil) activator:SetAttributeValue("hidden primary max ammo bonus", nil) activator:SetAttributeValue("override footstep sound set", nil) activator:SetAttributeValue("heal rate bonus", nil) activator:SetAttributeValue("ubercharge rate bonus", nil) activator:SetAttributeValue("patient overheal penalty", nil) activator:SetAttributeValue("cannot upgrade", nil) activator.m_bIsMiniBoss = 0 activator.m_flModelScale = 1 end end, 0) -- function OnWaveInit(wave) -- classSwapTime = 0 -- if SwapBackToClass then -- timer.Stop(SwapBackToClass) --this spews out an error on map reset, how to fix? -- end -- activator:SwitchClass(8) -- activator:AcceptInput("SetCustomModelWithClassAnimations", "") -- activator:SetAttributeValue("SET BONUS: move speed set bonus", nil) -- activator:SetAttributeValue("dmg from ranged reduced", nil) -- activator:SetAttributeValue("hidden primary max ammo bonus", nil) -- activator:SetAttributeValue("override footstep sound set", nil) -- activator:SetAttributeValue("heal rate bonus", nil) -- activator:SetAttributeValue("patient overheal penalty", nil) -- activator:SetAttributeValue("cannot upgrade", nil) -- activator.m_bIsMiniBoss = 0 -- activator.m_flModelScale = 1 -- activator:PlaySound("misc/halloween/spell_stealth.wav") -- activator:AcceptInput("RunScriptCode","DispatchParticleEffect(`teleported_red`,self.GetOrigin(),Vector(-90, 0, 0))") -- end end function CopyCatRevolver(damage, activator, caller) local isCritBot = 0 local getCallClass = caller.m_iClass if getCallClass == 8 or getCallClass == 9 then activator:AcceptInput("$DisplayTextChat", "{Red}Spies and Engineers aren't allowed. Denied.") return end local userBulletRes = activator:GetAttributeValue("dmg taken from bullets reduced") or 1 local userBlastRes = activator:GetAttributeValue("dmg taken from blast reduced") or 1 local userFireRes = activator:GetAttributeValue("dmg taken from fire reduced") or 1 local userCritRes = activator:GetAttributeValue("dmg taken from crit reduced") or 1 local userMoveSpeed = activator:GetAttributeValue("move speed bonus") or 1 local userRegen = activator:GetAttributeValue("health regen") or 0 if caller:InCond(34) and not caller:IsRealPlayer() then isCritBot = 1 end activator.copyItems = {} activator:SwitchClassInPlace(getCallClass) activator:AcceptInput("$DisplayTextChat", "{yellow}You Are Now {blue}"..tostring(caller:GetPlayerName())) activator:AcceptInput("SetCustomModelWithClassAnimations", tostring(caller.m_ModelName)) activator:PlaySound("misc/halloween/spell_teleport.wav") activator:AcceptInput("RunScriptCode","DispatchParticleEffect(`teleported_red`,self.GetOrigin(),Vector(-90, 0, 0))") activator.copyItems = caller:GetAllItems() -- PrintTable(activator.copyItems) timer.Simple(0.22, function() for i, items in pairs(activator.copyItems) do activator:GiveItem(activator.copyItems[i]:GetItemName(), activator.copyItems[i]:GetAllAttributeValues()) end end) timer.Simple(0.1, function() --thanks Wacev for this bit for attr,val in pairs(caller:GetAllAttributeValues()) do --get all attrs and their values from caller / attr = attribute name / val = attribute value if attr ~= "hidden maxhealth non buffed" then --don't copy the health of a bot activator:SetAttributeValue(attr, val) print(attr,": ",val) end end if caller.m_bIsMiniBoss == 1 then activator.m_flModelScale = 1.4 activator:AddHealth(1750, true) if getCallClass ~= 1 then activator:SetAttributeValue("SET BONUS: move speed set bonus", 0.75) end -- activator:SetAttributeValue("dmg from ranged reduced", 0.80) -- activator:SetAttributeValue("hidden primary max ammo bonus", 1.80) activator:SetAttributeValue("override footstep sound set", 6) activator:SetAttributeValue("heal rate bonus", 5) activator:SetAttributeValue("ubercharge rate bonus", 5) activator:SetAttributeValue("patient overheal penalty", -5) activator.m_bIsMiniBoss = 1 activator:SetAttributeValue("not solid to players", 1) --get yourself unstuck from players timer.Simple(1.5, function() activator:SetAttributeValue("not solid to players", nil) activator:SetAttributeValue("displace touched enemies", 1) --push away if stuck timer.Simple(1, function() activator:SetAttributeValue("displace touched enemies", nil) end) end) else activator:AddHealth(200, true) -- activator:SetAttributeValue("dmg from ranged reduced", 0.80) activator:SetAttributeValue("heal rate bonus", 2.5) activator:SetAttributeValue("ubercharge rate bonus", 5) activator:SetAttributeValue("patient overheal penalty", 0) -- activator.m_flModelScale = caller.activator.m_flModelScale end if not caller.IsRealPlayer() then activator:SetAttributeValue("hidden primary max ammo bonus", 10) activator:SetAttributeValue("hidden secondary max ammo penalty", 10) activator:SetAttributeValue("ammo regen", 1) end activator:SetAttributeValue("dmg taken from bullets reduced", userBulletRes) activator:SetAttributeValue("dmg taken from blast reduced", userBlastRes) activator:SetAttributeValue("dmg taken from fire reduced", userFireRes) activator:SetAttributeValue("dmg taken from crit reduced", userCritRes) activator:SetAttributeValue("move speed bonus", userMoveSpeed) activator:SetAttributeValue("health regen", userRegen) activator:SetAttributeValue("cannot upgrade", 1) if isCritBot == 1 then activator:AddCond(37, 30, Attacker) end end) local classSwapTime = 30 local SwapBackToClass SwapBackToClass = timer.Create(1, function () classSwapTime = classSwapTime - 1 if classSwapTime <= 5 and classSwapTime > 0 then activator:PlaySoundToSelf("weapons/det_pack_timer.wav") end activator:AcceptInput("$DisplayTextCenter", "Class copy ends in: "..classSwapTime, activator) --revert on timer if classSwapTime <= 0 then activator:SwitchClassInPlace(8) activator:AcceptInput("SetCustomModelWithClassAnimations", "") classSwapTime = 30 activator:SetAttributeValue("SET BONUS: move speed set bonus", nil) -- activator:SetAttributeValue("dmg from ranged reduced", nil) activator:SetAttributeValue("hidden primary max ammo bonus", nil) activator:SetAttributeValue("override footstep sound set", nil) activator:SetAttributeValue("heal rate bonus", nil) activator:SetAttributeValue("ubercharge rate bonus", nil) activator:SetAttributeValue("patient overheal penalty", nil) activator:SetAttributeValue("cannot upgrade", nil) activator.m_bIsMiniBoss = 0 activator.m_flModelScale = 1 activator:PlaySound("misc/halloween/spell_stealth.wav") activator:AcceptInput("RunScriptCode","DispatchParticleEffect(`teleported_red`,self.GetOrigin(),Vector(-90, 0, 0))") end --revert early if activator:IsAlive() == false then activator:SwitchClass(8) activator:AcceptInput("SetCustomModelWithClassAnimations", "") classSwapTime = 30 timer.Stop(SwapBackToClass) activator:SetAttributeValue("SET BONUS: move speed set bonus", nil) -- activator:SetAttributeValue("dmg from ranged reduced", nil) activator:SetAttributeValue("hidden primary max ammo bonus", nil) activator:SetAttributeValue("override footstep sound set", nil) activator:SetAttributeValue("heal rate bonus", nil) activator:SetAttributeValue("ubercharge rate bonus", nil) activator:SetAttributeValue("patient overheal penalty", nil) activator:SetAttributeValue("cannot upgrade", nil) activator.m_bIsMiniBoss = 0 activator.m_flModelScale = 1 end end, 30) -- function OnWaveInit(wave) -- classSwapTime = 0 -- if SwapBackToClass then -- timer.Stop(SwapBackToClass) --this spews out an error on map reset, how to fix? -- end -- activator:SwitchClass(8) -- activator:AcceptInput("SetCustomModelWithClassAnimations", "") -- activator:SetAttributeValue("SET BONUS: move speed set bonus", nil) -- activator:SetAttributeValue("dmg from ranged reduced", nil) -- activator:SetAttributeValue("hidden primary max ammo bonus", nil) -- activator:SetAttributeValue("override footstep sound set", nil) -- activator:SetAttributeValue("heal rate bonus", nil) -- activator:SetAttributeValue("patient overheal penalty", nil) -- activator:SetAttributeValue("cannot upgrade", nil) -- activator.m_bIsMiniBoss = 0 -- activator.m_flModelScale = 1 -- activator:PlaySound("misc/halloween/spell_stealth.wav") -- activator:AcceptInput("RunScriptCode","DispatchParticleEffect(`teleported_red`,self.GetOrigin(),Vector(-90, 0, 0))") -- end end