- Initiateur de la discussion
L
lamolia03
Geek suprême
- Messages
- 118
- Score réaction
- 0
- Points
- 100
Bonjour
J'aimerais modifier un script qui fait pour l'instant que quand on transforme une personne elle prend 1 point de dégât toutes les 1,5 secondes à peu près et j'aimerais qu'a la place de prendre 1 point de dégât, les gens prennent 20 points de dégâts toutes les 1,5 secondes.
Merci d'avance pour vos réponses.
J'aimerais modifier un script qui fait pour l'instant que quand on transforme une personne elle prend 1 point de dégât toutes les 1,5 secondes à peu près et j'aimerais qu'a la place de prendre 1 point de dégât, les gens prennent 20 points de dégâts toutes les 1,5 secondes.
Merci d'avance pour vos réponses.
Code:
AddCSLuaFile()
SWEP.Author = "BC BEST"
SWEP.Contact = "http://steamcommunity.com/id/spdbest/"
SWEP.Purpose = "Acts as a weapon for SCP 049."
SWEP.Instructions = "Left Click to turn a person into a zombie."
SWEP.Category = "SCP"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = ""
SWEP.WorldModel = ""
SWEP.PrintName = "SCP 017 SWEP"
SWEP.Slot = 3
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.SwingSound = ""
SWEP.HitSound = ""
SWEP.HoldType = "normal"
SWEP.AllowDrop = true
SWEP.Kind = WEAPON_MELEE
SWEP.Delay = 1
SWEP.Range = 100
SWEP.Damage = 0
SWEP.RemoveCan = true
SWEP.DocAndResearch = { TEAM_BRIGHT, TEAM_RIGHTS, TEAM_CLEF, TEAM_KONDRAKI, TEAM_GEARS, TEAM_RESEARCHER
}
SWEP.MTF = { TEAM_MTF, TEAM_MTFSNIPER, TEAM_MTFBREACHER, TEAM_MTFHEAVY, EAM_MTFLEADER, TEAM_MTFMEDIC, TEAM_SECURITY, TEAM_NINE
}
SWEP.MTFModel = "models/captainbigbutt/vocaloid/shadow_miku_append.mdl"
SWEP.InfectedModel = "models/captainbigbutt/vocaloid/shadow_miku_append.mdl"
SWEP.infectedTime = 300
SWEP.cooldown = 3*60
SWEP.currentInfectionCount = 0
SWEP.available = true
function SWEP:Deploy() if timer.Exists("049cooldown_"..self.Owner:EntIndex()) then self.available = false end
end
function SWEP:infectPlayer(ent) local ply = self.Owner if ent:IsPlayer() and ent != ply and not ent.IsInfected then if table.HasValue(self.DocAndResearch, ent:Team()) then if CLIENT then ply:EmitSound("") end else ent.EntModel = ent:GetModel() ent.IsInfected = true if self.available == true and timer.Exists("049cooldown_"..ply:EntIndex()) == true then timer.Remove("049cooldown_"..ply:EntIndex()) end self.available = false if CLIENT then if timer.Exists("049cooldown_"..ply:EntIndex()) then timer.Remove("049cooldown_"..ply:EntIndex()) end end timer.Create("049cooldown_"..ply:EntIndex(), self.cooldown, 1, function() self.available = true if timer.Exists("049cooldown_"..ply:EntIndex()) then timer.Remove("049cooldown_"..ply:EntIndex()) end end) if SERVER then ply:SendLua("chat.AddText( Color(255, 0, 0, 255), 'Vous avez aspiré votre cible avec succes!')") end timer.Simple(self.infectedTime+2, function() ent.IsInfected = false end) ply:EmitSound("") if SERVER then if table.HasValue(self.MTF, ent:Team()) then ent:SetModel(self.InfectedModel) else ent:SetModel(self.InfectedModel) end util.AddNetworkString("049_sendinfected_effects") util.AddNetworkString("049_cancelall") net.Start("049_sendinfected_effects") net.WriteString(tostring(self.infectedTime)) net.Send(ent) ent:StripWeapons() ent:Give("") hook.Add("PlayerDeath", "Revert_To_Model", function(pl) if pl == ent and ent.IsInfected then ent:SetModel(ent.EntModel) net.Start("049_cancelall") net.Send(pl) if timer.Exists("049_killing_"..ent:EntIndex()) then timer.Remove("049_killing_"..ent:EntIndex()) end if timer.Exists("049_killing_"..ent:EntIndex()) then timer.Remove("049_killing_dc_"..ent:EntIndex()) end ent.IsInfected = false end end) local hp = ent:Health() timer.Create("049_killing_"..ent:EntIndex(), 1, 0, function() if not ent.IsInfected then if timer.Exists("049_killing_"..ent:EntIndex()) then timer.Remove("049_killing_"..ent:EntIndex()) end end if ent:Health() <= 1 and ent:Alive() then ent:Kill() if timer.Exists("049_killing_"..ent:EntIndex()) then timer.Remove("049_killing_"..ent:EntIndex()) end end if ent:Health() > 0 then ent:TakeDamage(hp/self.infectedTime, ply, self) end end) timer.Create("049_killing_dc_"..ent:EntIndex(), self.infectedTime, 1, function() if ent.IsInfected then ent:Kill() if timer.Exists("049_killing_dc_"..ent:EntIndex()) then timer.Remove("049_killing_dc_"..ent:EntIndex()) end end end) end end end
end
function SWEP:PrimaryAttack() local ply = self.Owner local tr = util.TraceHull { start = ply:GetShootPos(), endpos = ply:GetShootPos() + ply:GetAimVector() * 1500, filter = ply, mins = Vector(-10, -10, -10), maxs = Vector(10, 10, 10) } if not tr.Entity then return end local ent = tr.Entity if not IsValid(ply) then return end ply:SetAnimation(PLAYER_ATTACK1) if tr.StartPos:Distance(tr.HitPos) < 100 then self:EmitSound(self.HitSound) else self:EmitSound(self.SwingSound) end local vm = self:GetOwner():GetViewModel() if not IsValid(vm) then return end vm:SendViewModelMatchingSequence(vm:LookupSequence("attackch")) vm:SetPlaybackRate(1 + 1/3) local duration = vm:SequenceDuration() / vm:GetPlaybackRate() local time = CurTime() + duration self:SetNextPrimaryFire(time) if ent:IsPlayer() and ent:Alive() then if ply:GetPos():Distance(ent:GetPos()) <= 100 then if ent.IsInfected != true then if self.available == true then self:infectPlayer(ent) else if not timer.Exists("049cooldown_"..ply:EntIndex()) then self.available = true self:PrimaryAttack() end if SERVER then ply:SendLua("chat.AddText( Color(255, 0, 0, 255), 'You still have "..string.FormattedTime( timer.TimeLeft("049cooldown_"..ply:EntIndex()), "%02i:%02i" ).." left on your cool down!')") end end else if SERVER then ply:SendLua("chat.AddText( Color(255, 0, 0, 255), 'Ce joueur est deja dans vous!')") end end end end
end
function SWEP:SecondaryAttack() if self.RemoveCan == true then self.Owner:EmitSound("") self.RemoveCan = false timer.Simple(2, function() self.RemoveCan = true end) end
end
function SWEP:Reload() if self.RemoveCan == true then self.Owner:EmitSound("") self.RemoveCan = false timer.Simple(2, function() self.RemoveCan = true end) end
end
if CLIENT then net.Receive("049_sendinfected_effects", function() local time = tonumber(net.ReadString()) LocalPlayer():ConCommand('') timer.Simple(time, function() if timer.Exists("049_dying") then timer.Remove("049_dying") end if IsValid(SCPPanel) then SCPPanel:Remove() end end) if not IsValid(SCPPanel) then SCPPanel = vgui.Create("DPanel") SCPPanel:SetSize(ScrW(), ScrH()) SCPPanel:SetPos(0,0) SCPPanel.Paint = function(self, w, h) surface.SetDrawColor(255, 0, 0, 100) surface.DrawRect(0, 0, w, h) end end timer.Simple(time/8, function() LocalPlayer():ConCommand("SCP-017 est en train de vous absorber.") end) timer.Simple(time/2, function() LocalPlayer():ConCommand("L'absorption arrive à son terme.") end) end) net.Receive("049_cancelall", function() if timer.Exists("049_dying") then timer.Remove("049_dying") end if IsValid(SCPPanel) then SCPPanel:Remove() end end) surface.CreateFont( "049hud", {font = "Roboto", size = 18, weight = 500} ) surface.SetFont("049hud") local hudWidth = select(1, surface.GetTextSize("Cooldown Timer: "..string.FormattedTime( 0, "%02i:%02i" ))) hudWidth = hudWidth+20 local hudHeight = select(2, surface.GetTextSize("C")) hudHeight = (hudHeight)+20 hook.Add("HUDPaint", "draw_049_info", function() if LocalPlayer():Alive() then if #LocalPlayer():GetWeapons() > 0 then if LocalPlayer():GetActiveWeapon():GetClass() == "scp_049" then draw.RoundedBox( 0, 15, 15, hudWidth, hudHeight, Color(40, 40, 40, 125) ) local time = "0" if timer.Exists("049cooldown_"..LocalPlayer():EntIndex()) then time = string.FormattedTime( timer.TimeLeft("049cooldown_"..LocalPlayer():EntIndex()), "%02i:%02i" ) else time = string.FormattedTime( 0, "%02i:%02i" ) end draw.SimpleText( "Cooldown Timer: "..time, "049hud", 25, 25, Color(255, 0, 0), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP ) end end end end)
end