Advertisement
Ice-Ware

Killstreaks Script For HiddenDevs Application

Sep 24th, 2024
1,020
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.65 KB | Source Code | 0 0
  1. --[ MADE BY ICEDEV (@TOMERTHEPRO1) ]--
  2.  
  3. --[ SERVICES ]--
  4. local Plrs = game:GetService("Players")
  5. local RS = game:GetService("ReplicatedStorage")
  6.  
  7. --[ REPLICATED STORAGE ]--
  8. local Killstreaks = RS:WaitForChild("Killstreaks")
  9. local Assets = RS:WaitForChild("Assets")
  10. local Sounds = RS:WaitForChild("Sounds")
  11. local Remotes = RS:WaitForChild("Remotes")
  12.  
  13. -- Remotes
  14. local soundRemote = Remotes.PlaySound
  15. local camRemote = Remotes.SetCamera
  16.  
  17. -- Killstreaks
  18. local visionks = Killstreaks.Vision
  19. local airpackageks = Killstreaks.AirPackage
  20. local juggernautk = Killstreaks.Juggernaut
  21. local psychomodeks = Killstreaks.PsychoMode
  22. local flamethrowerks = Killstreaks.Flamethrower
  23. local rcxdks = Killstreaks.RCXD
  24.  
  25. -- Sounds
  26. local atvSFX = Sounds.aThermalVision
  27. local etvSFX = Sounds.eThermalVision
  28. local alpSFX = Sounds.aLandingPackage
  29. local elpSFX = Sounds.eLandingPackage
  30. local apmSFX = Sounds.aPsycho
  31. local epmSFX = Sounds.ePsycho
  32. local aftSFX = Sounds.aFlamethrower
  33. local eftSFX = Sounds.eFlamethrower
  34.  
  35. -- Assets
  36. local highlight = Assets.Highlight
  37. local airpackage = Assets.AirPackage
  38. local jnweapon = Assets.Minigun
  39. local jnarmor = Assets.Juggernaut
  40. local psychoknife = Assets.Knife
  41. local flamethrower = Assets.Flamethrower
  42. local car = Assets.Car
  43. local animate = Assets.Animate
  44.  
  45. local streaks = {}
  46.  
  47. --[ PLAYER ADDED ]--
  48. Plrs.PlayerAdded:Connect(function(plr)
  49.     plr.CharacterAdded:Connect(function(char)
  50.         local hum:Humanoid = char:WaitForChild("Humanoid")
  51.         local ch = hum.Health
  52.        
  53.         hum.HealthChanged:Connect(function(health)
  54.             if health < ch and char:FindFirstChild("Resistance") then -- if it got damaged
  55.                 local res = char.Resistance
  56.                
  57.                 if res:IsA("IntValue") then -- if player has resistance it reduces damage
  58.                     local dmg = ch-health
  59.                     local resDmg = dmg - dmg*(res.Value/100)
  60.  
  61.                     health = ch
  62.                     health -= resDmg
  63.                     print(dmg,resDmg)
  64.                 end
  65.             end
  66.             ch = health
  67.         end)
  68.     end)
  69. end)
  70.  
  71. --[ SOUND PLAYER FUNCTION ]--
  72. function playSound(plr:Player,allySound:Sound,enemySound:Sound)
  73.     local team = plr.Team
  74.     for i,v in Plrs:GetChildren() do
  75.         if v:IsA("Player") then
  76.             if v.Team == team then
  77.                 soundRemote:FireClient(v,allySound)
  78.             else
  79.                 soundRemote:FireClient(v,enemySound)
  80.             end
  81.         end
  82.     end
  83. end
  84. --[ MOVE MODEL FUNCTION ]--
  85. function moveModel(model:Model,cframe:CFrame)
  86.     for i,v in model:GetChildren() do
  87.         if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("BasePart") then
  88.             v.CFrame = cframe          
  89.         end
  90.     end
  91. end
  92. --[ CHANGE CHARACTER VISIBILITY ]--
  93. function charVis(char:Model,bool:BoolValue)
  94.     local visible = 0
  95.     if bool == true then
  96.         visible = 0
  97.     elseif bool == false then
  98.         visible = 1
  99.     end
  100.    
  101.     for i,v in char:GetDescendants() do
  102.         if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("BasePart") or v:IsA("Decal") then
  103.             if v.Name ~= "HumanoidRootPart" then
  104.                 v.Transparency = visible
  105.             end
  106.         elseif v:IsA("Accessory") and bool == false then
  107.             v:Destroy()
  108.         end
  109.     end
  110. end
  111. --[ CLONE CHARACTER FUNCTION ]--
  112. function cloneChar(char:Model)
  113.     char.Archivable = true
  114.     local clone = char:Clone()
  115.     clone.Name = char.Name.."Clone"
  116.     char.Archivable = false
  117.    
  118.     return clone
  119. end
  120.  
  121. --[ KILLSTREAK FUNCTIONS ]--
  122. streaks.VisionKS = function(plr:Player)
  123.     print("THERMAL VISION SERVER")
  124.     playSound(plr,atvSFX,etvSFX)
  125.     local team = plr.Team
  126.  
  127.     -- Add Highlight to Enemy Team
  128.     for i,v in workspace:GetChildren() do
  129.         if v:IsA("Model") and v:FindFirstChild("Humanoid") and Plrs:FindFirstChild(v.Name) then -- if its a player
  130.             local plr2 = Plrs:GetPlayerFromCharacter(v)
  131.             if plr2.Team ~= plr.Team then -- if player is in enemy team
  132.                 print("KILLSTREAK BEGUN: "..v.Name)
  133.                 local hClone = highlight:Clone()
  134.                 hClone.Parent = v
  135.             end
  136.         end
  137.     end
  138.     task.wait(20) -- 20 seconds duration
  139.     for i,v in workspace:GetChildren() do
  140.         -- if its a player and the player is highlighted
  141.         if v:IsA("Model") and v:FindFirstChild("Humanoid") and Plrs:FindFirstChild(v.Name) and v:FindFirstChild("Highlight") then
  142.             v.Highlight:Destroy()
  143.         end
  144.     end
  145. end
  146. streaks.AirPackageKS = function(plr:Player)
  147.     print("AIR PACKAGE SERVER",streaks)
  148.     playSound(plr,alpSFX,elpSFX)
  149.    
  150.     local apClone = airpackage:Clone()
  151.     local prompt = apClone.ProximityPrompt
  152.     apClone.Parent = workspace
  153.     apClone.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,20,-5)
  154.  
  155.     prompt.Triggered:Connect(function() -- When air package is used
  156.         apClone:Destroy()
  157.         local count = {}
  158.        
  159.         -- Choose random streak if its not the same one
  160.         for i,v in pairs(streaks) do
  161.             if v ~= streaks.AirPackageKS then
  162.                 print(v)
  163.                 table.insert(count,i)
  164.             end
  165.         end
  166.         local randStreak = count[math.random(1,#count)]
  167.         streaks[randStreak](plr)
  168.     end)
  169. end
  170. streaks.JuggernautKS = function(plr:Player)
  171.     print("JUGGERNAUT SERVER")
  172.     local char = plr.Character or plr.CharacterAdded:Wait()
  173.     local hum:Humanoid = char:FindFirstChild("Humanoid")
  174.     local res = Instance.new("IntValue")
  175.     local jnwClone = jnweapon:Clone()
  176.     local cFolder = Instance.new("Folder",char)
  177.     cFolder.Name = "ClothesFolder"
  178.    
  179.     -- Resistance Value removed 60 seconds after
  180.     jnwClone.Parent = plr.Backpack
  181.     res.Name = "Resistance"
  182.     res.Value = 50
  183.     res.Parent = char
  184.    
  185.     -- Check Character Shirt & Pants
  186.     for i,v in char:GetChildren() do
  187.         if v:IsA("Shirt") or v:IsA("Pants") then
  188.             v.Parent = char:FindFirstChild("ClothesFolder")
  189.         end
  190.     end
  191.    
  192.     -- Add Juggernaut Armor
  193.     for i,v in jnarmor:GetChildren() do
  194.         if v:IsA("Accessory") or v:IsA("Shirt") or v:IsA("Pants") then
  195.             local item = v:Clone()
  196.             local val = Instance.new("BoolValue",item)
  197.             val.Name = "Juggernaut"
  198.             item.Parent = char
  199.         end
  200.     end
  201.    
  202.     task.wait(60)
  203.     res:Destroy()
  204.     hum:UnequipTools()
  205.     task.wait(.1)
  206.     jnwClone:Destroy()
  207.     for i,v in char:GetChildren() do
  208.         if v:IsA("Accessory") or v:IsA("Shirt") or v:IsA("Pants") then
  209.             if v:FindFirstChild("Juggernaut") then
  210.                 v:Destroy()
  211.             end
  212.         elseif v:IsA("Folder") and v.Name == "ClothesFolder" then
  213.             for i,v in v:GetChildren() do
  214.                 v.Parent = char
  215.             end
  216.             v:Destroy()
  217.         end
  218.     end
  219. end
  220. streaks.PsychoModeKS = function(plr:Player)
  221.     print("PSYCHO SERVER")
  222.     playSound(plr,apmSFX,epmSFX)
  223.    
  224.     local char = plr.Character
  225.     local hum:Humanoid = char:FindFirstChild("Humanoid")
  226.     hum.WalkSpeed = 36
  227.    
  228.     local pskClone = psychoknife:Clone()
  229.     pskClone.Parent = plr.Backpack
  230.    
  231.     -- Player Invincibility
  232.     local res = Instance.new("IntValue")
  233.     res.Name = "Resistance"
  234.     res.Value = 100 -- 100% Resistance
  235.     res.Parent = char
  236.    
  237.     task.wait(10)
  238.     hum:UnequipTools()
  239.     task.wait(.1)
  240.     pskClone:Destroy()
  241.     res:Destroy()
  242.     hum.WalkSpeed = 16
  243. end
  244. streaks.FlamethrowerKS = function(plr:Player)
  245.     print("FLAMETHROWER SERVER")
  246.     playSound(plr,aftSFX,eftSFX)
  247.    
  248.     local char = plr.Character
  249.     local hum:Humanoid = char:FindFirstChild("Humanoid")
  250.     local ftClone = flamethrower:Clone()
  251.    
  252.     ftClone.Parent = plr.Backpack
  253. end
  254. streaks.RCXD = function(plr:Player)
  255.     local char = plr.Character or plr.CharacterAdded:Wait()
  256.     local hrt:BasePart = char:WaitForChild("HumanoidRootPart")
  257.     local carClone = car:Clone()
  258.     local ppart = carClone.PrimaryPart
  259.     -- if ppart then print(ppart.Name) else warn("no pp :^(") end
  260.    
  261.     local clone:Model = cloneChar(char)
  262.     local cHum:Humanoid = clone:FindFirstChild("Humanoid")
  263.     local cHrt:Part = clone:FindFirstChild("HumanoidRootPart")
  264.     -- if cHum then print("Found clone humanoid!") else warn("Didn't find clone humanoid!") end
  265.    
  266.     carClone.Parent = workspace
  267.     moveModel(carClone,hrt.CFrame)
  268.     charVis(char,false)
  269.    
  270.     task.wait(.1)
  271.    
  272.     clone.Parent = workspace
  273.     cHrt.CFrame = cHrt.CFrame + Vector3.new(0,0,5)
  274.     charVis(clone,true)
  275.     camRemote:FireClient(plr,ppart)
  276.    
  277.     -- Make car explode when touched
  278.     ppart.Touched:Connect(function(hit:BasePart)
  279.         -- If the hit's parent is a player and is not the player driving the car
  280.         if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= char.Name.."Clone" and hit.Parent.Name ~= char.Name then
  281.             local enemy = hit.Parent
  282.             local ehrt = enemy:FindFirstChild("HumanoidRootPart")
  283.             local ehum:Humanoid = enemy:FindFirstChild("Humanoid")
  284.             local e = Instance.new("Explosion",ppart) -- Explosion to spawn on the enemy
  285.             e.Position = ppart.Position
  286.             task.wait(.25)
  287.             ehum.Health = 0
  288.             plr.Character = clone
  289.            
  290.             camRemote:FireClient(plr,plr.Character:WaitForChild("Humanoid"))
  291.             animate:Clone().Parent = plr.Character
  292.            
  293.             carClone:Destroy()
  294.         end
  295.     end)
  296.    
  297. end
  298.  
  299. --[ CONNCET STREAKS TO REMOTE FUNCTIONS ]--
  300. visionks.OnServerInvoke = streaks.VisionKS
  301. airpackageks.OnServerInvoke = streaks.AirPackageKS
  302. juggernautk.OnServerInvoke = streaks.JuggernautKS
  303. psychomodeks.OnServerInvoke = streaks.PsychoModeKS
  304. flamethrowerks.OnServerInvoke = streaks.FlamethrowerKS
  305. rcxdks.OnServerInvoke = streaks.RCXD
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement