Advertisement
scriptingtales

Roblox Giygas Script Test

Jun 12th, 2023
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.90 KB | None | 0 0
  1. --RAW version: 3.4.0
  2. --Require version: 3.4.0
  3.  
  4. --BASIC VARIABLES
  5.  
  6. local RunService = game:GetService("RunService")
  7.  
  8. local NoHint = true
  9. local player = owner.Name
  10. local playerbin = game.Players[player]
  11. local character = playerbin.Character
  12.  
  13. local h = Instance.new("Hint") --playerbin.PlayerGui
  14. if NoHint == false then
  15.     h.Parent = workspace
  16. end
  17.  
  18. --STATS
  19. local msg = ". . ."
  20.  
  21. local psirate = 128
  22. local phase = 1
  23. local staticphase = 1
  24. local psiMAX = 2000 --6000
  25. local psi = psiMAX
  26.  
  27. local humanoid = character.Humanoid
  28. humanoid.MaxHealth = 4000 --6000
  29. humanoid.Health = humanoid.MaxHealth
  30. humanoid.WalkSpeed = (36/(psiMAX+humanoid.MaxHealth))*(psi+humanoid.Health) -- 36 is the default walkspeed
  31.  
  32. --TEXTURES
  33.  
  34. local tex_jumpscares = {"http://www.roblox.com/asset/?id=4204898333","http://www.roblox.com/asset/?id=15016407","http://www.roblox.com/asset/?id=9118806617","http://www.roblox.com/asset/?id=6337170651"}
  35. local aud_cutout = {"rbxassetid://8724367184","rbxassetid://7224422552","rbxassetid://5171923555"}
  36. local aud_prejump = {"rbxassetid://7229804590","rbxassetid://4883181281","rbxassetid://6932519682"}
  37.  
  38. local tex_hitbox = "http://www.roblox.com/asset/?id=48272732"
  39. local tex_giygas = "http://www.roblox.com/asset/?id=12708018814"
  40. local tex_damage = "http://www.roblox.com/asset/?id=480633900"
  41. local tex_wounded = "rbxassetid://29625151"
  42. local tex_fatal = "http://www.roblox.com/asset/?id=37453694"
  43.  
  44. --MATH FUNCTIONS
  45.  
  46. local X = 0
  47. local fun_BGmovement_XZ = 1
  48. local fun_BGmovement_Y = 2*math.sin(X/20)
  49. local fun_stability = 8
  50. --local fun_color = Vector3.new(1,1,1)
  51.  
  52. local bg = Instance.new("Part",character)
  53. bg.Size = Vector3.new(1,1,1)
  54. bg.Transparency = 1
  55. bg.Anchored = true
  56. bg.CanCollide = false
  57. bg.CanTouch = false
  58.  
  59. local bg_mesh = Instance.new("SpecialMesh",bg)
  60. bg_mesh.MeshId = "rbxassetid://1527559"
  61. bg_mesh.TextureId = tex_wounded
  62. bg_mesh.Scale = Vector3.new(1024, 768, -1024)
  63.  
  64. --SCRIPT PROPER
  65.  
  66. local music = Instance.new("Sound",character)
  67. music.SoundId = "rbxassetid://13048821234"
  68. music.Looped = true
  69. music.Volume = 6
  70.  
  71. local ambience = Instance.new("Sound",character.Head)
  72. ambience.SoundId = "rbxassetid://196346387"
  73. ambience.Volume = 2
  74. ambience.Looped = true
  75. ambience:Play()
  76.  
  77. local shriek = Instance.new("Sound",character.Head)
  78. shriek.SoundId = "rbxassetid://163684930"
  79. shriek.Volume = 3
  80. shriek.PlaybackSpeed = 0.75
  81. shriek.Looped = true
  82. shriek:Play()
  83.  
  84. character.Health:Destroy()
  85. character.Animate:Destroy()
  86. local x1 = character:GetChildren()
  87.  
  88. for i = 1,#x1 do
  89.     if x1[i]:IsA("BasePart") then
  90.         x1[i].Transparency = 1
  91.     elseif x1[i].ClassName == "Accessory" then
  92.         x1[i]:Destroy()
  93.     end
  94. end
  95.  
  96. character.Head.face:Destroy()
  97.  
  98. function playSFX(id, vol, pitch)
  99.     local sound = Instance.new("Sound",character.Head)
  100.     sound.SoundId = id
  101.     sound.Volume = vol
  102.     sound.PlaybackSpeed = pitch
  103.     sound.PlayOnRemove = true
  104.     sound:Destroy()
  105. end
  106. local light = Instance.new("PointLight",character.Head)
  107. light.Range = 12
  108. light.Color = Color3.new(1,0,0)
  109. light.Brightness = 6
  110.  
  111. local fogholder = Instance.new("Part")
  112. fogholder.Locked = true
  113. fogholder.Transparency = 1
  114. fogholder.CanCollide = false
  115. fogholder.Anchored = true
  116.  
  117. local BG = function()
  118.     for X = 1,math.huge do
  119.         RunService.Heartbeat:Wait()
  120.         bg.Rotation = bg.Rotation + Vector3.new(fun_BGmovement_XZ,fun_BGmovement_Y,fun_BGmovement_XZ)
  121.  
  122.         if phase >= 2 then
  123.             bg.Transparency = 0.6 + math.sin(X/fun_stability)/6
  124.         end
  125.  
  126.         if phase == 3 then
  127.             bg_mesh.VertexColor = Vector3.new(32 + 32*math.cos(X/4),32 +32*math.sin(X/4),32 + 32*math.sin(X/4))
  128.         elseif phase == 4  then
  129.             bg_mesh.VertexColor = Vector3.new(9*math.sin(X/4),6*math.cos(X/4),6*math.cos(X/4))
  130.         end
  131.  
  132.         fogholder.Position = character.HumanoidRootPart.Position + Vector3.new(20*math.sin(X/150)*math.cos(X/75),0,40*math.cos(X/150)*math.sin(X/100))
  133.     end
  134. end
  135.  
  136. local co_BG = coroutine.create(BG)
  137.  
  138. fogholder.Parent = character
  139.  
  140. local CLK = function()
  141.     while RunService.Heartbeat:Wait() do
  142.         humanoid.WalkSpeed = (24/(psiMAX+humanoid.MaxHealth))*(psi+humanoid.Health)
  143.         bg.Position = character.HumanoidRootPart.Position
  144.         if NoHint == false then
  145.             h.Text = "HP: " ..humanoid.Health.. "/" ..humanoid.MaxHealth.. " PSI: " .. math.floor(psi+0.5) .. "/" ..psiMAX.. " [ "..msg.." ] "
  146.         end
  147.         light.Brightness = (6/humanoid.MaxHealth)*humanoid.Health
  148.         if psi >= psiMAX then
  149.             psi = psiMAX
  150.         else
  151.             psi = psi + psirate/60
  152.         end
  153.     end
  154. end
  155.  
  156. local co_CLK = coroutine.create(CLK)
  157.  
  158. coroutine.resume(co_CLK)
  159. --coroutine.resume(co_BG)
  160.  
  161. local Hitbox_FX = Instance.new("ParticleEmitter",character.Head)
  162. Hitbox_FX.Speed = NumberRange.new(0.05,0.05)
  163. Hitbox_FX.Color = ColorSequence.new(Color3.new(0.16,0.16,0.16),Color3.new(.33,0.08,0.08))
  164. Hitbox_FX.Transparency = NumberSequence.new{
  165.     NumberSequenceKeypoint.new(0,1),
  166.     NumberSequenceKeypoint.new(0.5,0),
  167.     NumberSequenceKeypoint.new(1,1),
  168. }
  169. Hitbox_FX.Size = NumberSequence.new(5,5)
  170. Hitbox_FX.LightEmission = 1
  171. Hitbox_FX.LightInfluence = 1
  172. Hitbox_FX.Texture = tex_hitbox
  173. Hitbox_FX.Lifetime = NumberRange.new(4,4)
  174. Hitbox_FX.RotSpeed = NumberRange.new(-2.5,2.5)
  175. Hitbox_FX.LockedToPart = true
  176. Hitbox_FX.Orientation = Enum.ParticleOrientation.FacingCameraWorldUp
  177. Hitbox_FX.Rate = 0.25
  178.  
  179.  
  180. local Giygas_Fog = Instance.new("ParticleEmitter")
  181. Giygas_Fog.Name = "Fog"
  182. Giygas_Fog.Parent = fogholder
  183. Giygas_Fog.Speed = NumberRange.new(1, 1)
  184. Giygas_Fog.Orientation = Enum.ParticleOrientation.VelocityParallel
  185. Giygas_Fog.Color = ColorSequence.new(Color3.new(1, 0.25, 0.25),Color3.new(1, 0.25, 0.25))
  186. Giygas_Fog.LightEmission = 1
  187. Giygas_Fog.LightInfluence = 1
  188. Giygas_Fog.RotSpeed = NumberRange.new(0,6)
  189. Giygas_Fog.LockedToPart = true
  190. Giygas_Fog.Squash = NumberSequence.new{
  191.     NumberSequenceKeypoint.new(0,-0.4),
  192.     NumberSequenceKeypoint.new(0.7,0),
  193.     NumberSequenceKeypoint.new(1,-1.5),
  194. }
  195. Giygas_Fog.Texture = tex_giygas
  196. Giygas_Fog.Transparency = NumberSequence.new{
  197.     NumberSequenceKeypoint.new(0,1),
  198.     NumberSequenceKeypoint.new(0.5,0),
  199.     NumberSequenceKeypoint.new(1,1),
  200. }
  201. Giygas_Fog.ZOffset = 50
  202. Giygas_Fog.Size = NumberSequence.new(20,20)
  203. Giygas_Fog.Brightness = 0
  204. Giygas_Fog.Lifetime = NumberRange.new(6, 6)
  205. Giygas_Fog.Rate = 2
  206. Giygas_Fog.SpreadAngle = Vector2.new(180, -180)
  207. Giygas_Fog.VelocitySpread = 180
  208.  
  209. local DamageFX = Instance.new("ParticleEmitter")
  210. Script1 = Instance.new("Script")
  211. DamageFX.Parent = character.HumanoidRootPart
  212. DamageFX.Speed = NumberRange.new(300, 300)
  213. DamageFX.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  214. DamageFX.Enabled = false
  215. DamageFX.LightEmission = 1
  216. DamageFX.LightInfluence = 1
  217. DamageFX.Texture = "http://www.roblox.com/asset/?id=480633900"
  218. Giygas_Fog.Transparency = NumberSequence.new{
  219.     NumberSequenceKeypoint.new(0,1),
  220.     NumberSequenceKeypoint.new(0.5,0),
  221.     NumberSequenceKeypoint.new(1,1),
  222. }
  223. DamageFX.ZOffset = 0
  224. DamageFX.Size = NumberSequence.new(100,100)
  225. DamageFX.Brightness = 0
  226. DamageFX.Lifetime = NumberRange.new(0.125, 0.125)
  227. DamageFX.Rate = 400
  228. DamageFX.SpreadAngle = Vector2.new(0, 360)
  229.  
  230. function static(length)
  231.     local players = game:GetService("Players"):GetChildren()
  232.     for x = 1,#players do
  233.         local h = players[x]
  234.         local drop = h.PlayerGui
  235.         local static = Instance.new("ScreenGui")
  236.         static.Name = "Static"
  237.         local prex = drop:FindFirstChild("Static")
  238.         if prex == nil then
  239.             static.Parent = drop
  240.         elseif prex ~= static and humanoid.Health >= 1 then
  241.             prex:Destroy()
  242.         end
  243.            
  244.         local image = Instance.new("ImageLabel",static)
  245.         local sound = Instance.new("Sound",static)
  246.         sound.SoundId = "rbxassetid://170092034"
  247.         sound.Looped = true
  248.         sound.Volume = 0.5
  249.         sound.PlaybackSpeed = 0.2
  250.         image.ImageColor3 = Color3.new(1,0,0)
  251.         sound:Play()
  252.         image.BackgroundTransparency = 1
  253.         image.Transparency = 0.8
  254.         image.Size = UDim2.new(1,0,1,0)
  255.         for i = 1,1*length do
  256.             image.Image = "http://www.roblox.com/asset/?id=10218289720"
  257.             RunService.Heartbeat:Wait()
  258.             image.Image = "http://www.roblox.com/asset/?id=10218295778"
  259.             RunService.Heartbeat:Wait()
  260.             image.Image = "http://www.roblox.com/asset/?id=10218298795"
  261.             RunService.Heartbeat:Wait()
  262.             image.Image = "http://www.roblox.com/asset/?id=10218303689"
  263.             RunService.Heartbeat:Wait()
  264.             image.Image = "http://www.roblox.com/asset/?id=10218307266"
  265.             RunService.Heartbeat:Wait()
  266.             image.Image = "http://www.roblox.com/asset/?id=10218303689"
  267.             RunService.Heartbeat:Wait()
  268.             image.Image = "http://www.roblox.com/asset/?id=10218298795"
  269.             RunService.Heartbeat:Wait()
  270.             image.Image = "http://www.roblox.com/asset/?id=10218295778"
  271.             RunService.Heartbeat:Wait()
  272.         end
  273.         static:Destroy()
  274.     end
  275. end
  276.  
  277. humanoid.HealthChanged:connect(function()
  278.     DamageFX.Enabled = true
  279.     playSFX("rbxassetid://7074143771", 0.25, 1)
  280.     for i = 1,5 do
  281.         RunService.Heartbeat:Wait()
  282.     end
  283.     playSFX("rbxassetid://1097541069", 1, math.random(80,120)/100)
  284.     DamageFX.Enabled = false
  285.     if math.random(1,1000) <= 166*staticphase and humanoid.Health >= 0 then
  286.         static(math.random(1,15))
  287.     end  
  288. end)
  289.  
  290. humanoid.Died:connect(function()
  291.    
  292.     music:Destroy()
  293.     ambience:Destroy()
  294.     shriek:Destroy()
  295.     bg:Destroy()
  296.     Giygas_Fog.Enabled = false
  297.     Hitbox_FX.Enabled = false
  298.    
  299.     local death = Instance.new("Sound",workspace)
  300.     death.SoundId = "rbxassetid://5385069016"
  301.     death.PlayOnRemove = true
  302.     death:Destroy()
  303.     static(40)
  304.    
  305. end)
  306.  
  307. --PHASES
  308.  
  309. coroutine.resume(co_BG)
  310.  
  311. humanoid.HealthChanged:connect(function()
  312.     if humanoid.Health <= humanoid.MaxHealth*(67/100) then
  313.         phase = 2
  314.         staticphase = 2
  315.         ambience.PlaybackSpeed = 1.25
  316.         psirate = 192
  317.         Giygas_Fog.Lifetime = NumberRange.new(3,3)
  318.         Giygas_Fog.Rate = 4
  319.         if music.Playing ~= true then
  320.             music:Play()
  321.         end
  322.     end
  323.  
  324.     if humanoid.Health <= humanoid.MaxHealth*(33/100) then
  325.         phase = 3
  326.         ambience.PlaybackSpeed = 1.75
  327.         staticphase = 4
  328.         psirate = 512
  329.         Giygas_Fog.Lifetime = NumberRange.new(2,2)
  330.         fun_BGmovement_Y = 2*math.sin(X/16)
  331.         fun_BGmovement_XZ = 8
  332.         Giygas_Fog.Rate = 8
  333.         fun_stability = 4
  334.         bg_mesh.TextureId = tex_fatal
  335.         music.SoundId = "rbxassetid://13048824379"
  336.     end
  337.  
  338.     if humanoid.Health <= humanoid.MaxHealth*(16/100) then
  339.         ambience.PlaybackSpeed = 2
  340.         staticphase = 6
  341.         phase = 4
  342.         psirate = 1024
  343.         fun_BGmovement_Y = 8*math.sin(X/4)
  344.         fun_BGmovement_XZ = 24
  345.         Giygas_Fog.Lifetime = NumberRange.new(1,1)
  346.         Giygas_Fog.Rate = 12
  347.         fun_stability = 2
  348.         music.SoundId = "rbxassetid://13048827883"
  349.     end
  350.  
  351. end)
  352.  
  353. --PSI and ATTACKS
  354.  
  355. function crit(probability)
  356.     if math.random(0,1000) <= probability then
  357.         return true
  358.     else
  359.         return false
  360.     end
  361. end
  362.  
  363. local doing_magic = false
  364.  
  365. --humanoid.Touched:connect(function(y)
  366. --  local enemy = y.Parent:FindFirstChildOfClass("Humanoid")
  367. --  if enemy ~= nil and enemy.Parent.Name ~= player then
  368. --      enemy:TakeDamage(2)
  369. --  end
  370. --end)
  371.  
  372. local t_Lifeup = Instance.new("Tool",playerbin.Backpack)
  373. t_Lifeup.Name = "PK Lifeup (800 PSI)"
  374. t_Lifeup.RequiresHandle = false
  375.  
  376. t_Lifeup.Activated:Connect(function()
  377.     if doing_magic == false and psi >= 600  then
  378.         doing_magic = true
  379.         msg = "Giygas tries PK Lifeup!"
  380.         playSFX("rbxassetid://13048879322",10,1)
  381.         wait(1)
  382.         msg = ". . ."
  383.         psi = psi - 800
  384.         humanoid.Health = humanoid.Health + 200
  385.         playSFX("rbxassetid://2226293507",3,1)
  386.         wait(4)
  387.         doing_magic = false
  388.     end
  389. end)
  390.  
  391. local t_Freeze = Instance.new("Tool",playerbin.Backpack)
  392.  
  393. t_Freeze.Name = "PK Freeze (150 PSI)"
  394. t_Freeze.RequiresHandle = false
  395. t_Freeze.Activated:Connect(function()
  396.     if doing_magic == false and psi >= 150 then
  397.         doing_magic = true
  398.         msg = "Giygas tries PK Freeze!"
  399.         playSFX("rbxassetid://13048879322",10,1)
  400.         wait(1)
  401.         msg = ". . ."
  402.         psi = psi - 150
  403.         playSFX("rbxassetid://13049208249",10,1)
  404.         local e = Instance.new("Explosion",workspace)
  405.         e.BlastRadius = 48
  406.         e.Visible = false
  407.         e.Position = character.Head.Position
  408.         e.BlastPressure = 0
  409.         e.Hit:Connect(function(part,distance)
  410.             if distance <= 64 and part.Parent ~= character then
  411.                 local hum = part.Parent:FindFirstChildOfClass("Humanoid")
  412.                 if hum ~= nil then
  413.                     local ice = Instance.new("Part")
  414.                     ice.Name = "Ice"
  415.                     ice.Anchored = true
  416.                     part.Anchored = true
  417.                     ice.BrickColor = BrickColor.Blue()
  418.                     ice.Transparency = 0.5
  419.                     ice.Material = Enum.Material.Ice
  420.                     ice.CFrame = part.CFrame
  421.                     ice.Size = Vector3.new(6,8,6)
  422.                     ice.Parent = workspace
  423.                     wait(1.5)
  424.                     part.Anchored = false
  425.                     ice.Material = Enum.Material.Neon
  426.                     ice.Shape = 0
  427.                     ice.CanCollide = false
  428.                     if crit(4) == true then
  429.                         playSFX("rbxassetid://8789851536",5,1)
  430.                         hum:TakeDamage(math.huge) --instakill
  431.                     end
  432.                     for i = 1,15 do
  433.                         RunService.Heartbeat:Wait()
  434.                         ice.Transparency = ice.Transparency + 0.5/15
  435.                         ice.Size = ice.Size + Vector3.new(2,2,2)
  436.                     end
  437.                     ice:Destroy()
  438.                     hum.PlatformStand = true
  439.                     hum:TakeDamage(45)
  440.                     wait(3)
  441.                     hum.PlatformStand = false
  442.                 end            
  443.             end
  444.         end)
  445.         wait(1/phase)
  446.         doing_magic = false
  447.     end
  448. end)
  449.  
  450. function DamageHumanoids(range, damage, chance)
  451.     local x = workspace:GetChildren()
  452.     for i = 1,#x do
  453.         if x[i]:IsA("Model") and x[i].Name ~= player then
  454.             local hum = x[i]:FindFirstChildOfClass("Humanoid")
  455.             if hum~= nil and hum.Parent:FindFirstChild("Head") ~= nil then
  456.                 if math.abs((hum.Parent.Head.Position - character.HumanoidRootPart.Position).Magnitude) <= range then
  457.                     hum:TakeDamage(damage)
  458.                     if crit(chance) == true then
  459.                         playSFX("rbxassetid://8789851536",5,1)
  460.                         if hum.Parent:FindFirstChild("Head") ~= nil then
  461.                             hum:TakeDamage(math.huge)
  462.                         end
  463.                     end
  464.                 end
  465.             end
  466.         end
  467.     end
  468. end
  469.  
  470. t_GiygasAtk = Instance.new("Tool",playerbin.Backpack)
  471. t_GiygasAtk.Name = "Giygas' Attack (1050 PSI)"
  472. t_GiygasAtk.RequiresHandle = false
  473. t_GiygasAtk.Activated:Connect(function()
  474.     if doing_magic == false and psi >= 1050 then
  475.         doing_magic = true
  476.         psi = psi - 1050
  477.         msg = "You cannot grasp the true form of Giygas' attack!"
  478.         playSFX("rbxassetid://13048879322",10,1)
  479.         wait(1)
  480.         msg = ". . ."
  481.         for i = 1,2 do
  482.             playSFX("rbxassetid://13048892034",10,1.2)
  483.             local ring = Instance.new("Part",workspace)
  484.             ring.Position = character.HumanoidRootPart.Position
  485.             ring.Anchored = true
  486.             ring.CastShadow = false
  487.             ring.CanCollide = false
  488.             ring.Material = Enum.Material.Neon
  489.             ring.Transparency = 0
  490.             ring.Orientation = Vector3.new(90,0,0)
  491.             ring.Size = Vector3.new(10,10,1)
  492.             ring.BrickColor = BrickColor.new("Hot pink")
  493.             local mesh = Instance.new("FileMesh",ring)
  494.             mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  495.             DamageHumanoids(60, math.random(400,700), 175)
  496.             for i = 1,30 do
  497.                 RunService.Heartbeat:Wait()
  498.                 ring.Size = ring.Size + Vector3.new(2,2,2)
  499.                 mesh.Scale = mesh.Scale + Vector3.new(8,8,8)
  500.                 ring.Transparency = (1/30)*i
  501.             end
  502.             ring:Destroy()
  503.         end
  504.         wait(2/phase)
  505.         doing_magic = false
  506.     end
  507. end)
  508.  
  509. local jumped = false
  510. local secret = false
  511. local secret_chance = 69 --69 by default
  512.  
  513. function KinderSurprise(hit)
  514.     local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  515.     if hum ~= nil and hit.Parent.Name ~= player and jumped == false then --and hit.Parent.Name ~= player
  516.         jumped = true
  517.         playSFX("rbxassetid://7322622109",5,1)
  518.         msg = "You cannot comprehend the true form of PK Trap!"
  519.         wait(1)
  520.         playSFX("rbxassetid://8789851536",5,1.3)
  521.         hum.PlatformStand = true
  522.         hum.Parent.PrimaryPart.Velocity = hum.Parent.PrimaryPart.CFrame.LookVector*100
  523.         local unfortunate = game.Players:GetPlayerFromCharacter(hum.Parent)
  524.         if game.Players:GetPlayerFromCharacter(hum.Parent) ~= nil then --Surprise jumpscare!
  525.             local vox = Instance.new("Sound",unfortunate.PlayerGui)
  526.             local jumpscare = Instance.new("ScreenGui",unfortunate.PlayerGui)
  527.            
  528.             jumpscare.Name = "HERE"
  529.             jumpscare.Enabled = true
  530.            
  531.             local image = Instance.new("ImageLabel",jumpscare)
  532.             print(image.Name .. " PRESENT! KENICHI!")
  533.             image.Active = true
  534.             image.Size = UDim2.new(1,0,1,0)
  535.            
  536.             local click = Instance.new("Sound",unfortunate.PlayerGui)
  537.             click.SoundId = "rbxassetid://7811669782"
  538.             click.Volume = 10
  539.             click:Play()
  540.            
  541.             image.Image = "http://www.roblox.com/asset/?id=7188341508"
  542.             image.ImageColor3 = Color3.new(0,0,0)
  543.             wait(0.03)
  544.             image.ImageColor3 = Color3.new(1,1,1)
  545.             wait(0.03)
  546.             image.ImageColor3 = Color3.new(0,0,0)
  547.             wait(0.03)
  548.             image.ImageColor3 = Color3.new(1,1,1)
  549.            
  550.             image.Image = "http://www.roblox.com/asset/?id=9468576413"
  551.            
  552.             vox.SoundId = aud_cutout[math.random(1,#aud_cutout)]
  553.             vox.Volume = 3
  554.             vox:Play()
  555.            
  556.             wait(vox.TimeLength)
  557.            
  558.             click:Play()
  559.            
  560.             image.Image = "http://www.roblox.com/asset/?id=7188341508"
  561.             image.ImageColor3 = Color3.new(0,0,0)
  562.             wait(0.03)
  563.             image.ImageColor3 = Color3.new(1,1,1)
  564.             wait(0.03)
  565.             image.ImageColor3 = Color3.new(0,0,0)
  566.             wait(0.03)
  567.             image.ImageColor3 = Color3.new(1,1,1)
  568.  
  569.            
  570.             image.Image = "http://www.roblox.com/asset/?id=78918078"
  571.             vox:Stop()
  572.             vox.SoundId = aud_prejump[math.random(1,#aud_prejump)]
  573.             vox.Volume = 5
  574.             vox:Play()
  575.  
  576.            
  577.             wait(vox.TimeLength)
  578.            
  579.            
  580.             local screech = Instance.new("Sound",unfortunate.PlayerGui)
  581.            
  582.             screech.Volume = 2
  583.             screech.Looped = true
  584.             screech.SoundId = "rbxassetid://9078619391"
  585.            
  586.             if math.random(0,1000) <= secret_chance then
  587.                 secret = true
  588.                 image.Image = "http://www.roblox.com/asset/?id=10840742363"
  589.             else
  590.                 image.Image = tex_jumpscares[ math.random(1,#tex_jumpscares) ]
  591.                 screech.SoundId = "rbxassetid://6555091799" --rbxassetid://8280196339
  592.                 screech.PlaybackSpeed = 4
  593.             end
  594.            
  595.             screech:Play()
  596.            
  597.             for i = 1,(screech.TimeLength*8) do
  598.                 wait(0.125)
  599.                 image.ImageColor3 = Color3.new(1,0,0)
  600.                 wait(0.125)
  601.                 image.ImageColor3 = Color3.new(1,1,1)
  602.             end
  603.            
  604.             click:Play()
  605.             image.Image = "http://www.roblox.com/asset/?id=7188341508"
  606.             image.ImageColor3 = Color3.new(0,0,0)
  607.             wait(0.03)
  608.             image.ImageColor3 = Color3.new(1,1,1)
  609.             wait(0.03)
  610.             image.ImageColor3 = Color3.new(0,0,0)
  611.             wait(0.03)
  612.             image.ImageColor3 = Color3.new(1,1,1)
  613.  
  614.             screech:Destroy()
  615.             jumpscare.Enabled = false
  616.         end
  617.         if secret == false then
  618.             hum:TakeDamage(math.random(0,2400))
  619.             hum.MaxHealth = hum.MaxHealth*0.66
  620.         else
  621.             msg = "Suddenly, you have been saved by Whisper the Wolf!"
  622.             hum.Health = hum.Health + 500
  623.         end
  624.         hum.PlatformStand = false
  625.         playSFX("rbxassetid://4520789398",6,1)
  626.         jumped = false
  627.     end
  628. end
  629.  
  630. local con_cool = false
  631.  
  632. t_Confusion = Instance.new("Tool",playerbin.Backpack)
  633. t_Confusion.Name = "PK Trap (650 PSI)"
  634. t_Confusion.RequiresHandle = false
  635. t_Confusion.Activated:Connect(function()
  636.     if doing_magic == false and psi >= 650 and con_cool == false then
  637.         doing_magic = true
  638.         con_cool = true
  639.         psi = psi - 650
  640.         msg = "Giygas tries PK Trap!"
  641.         playSFX("rbxassetid://13048879322",10,1)
  642.         wait(1)
  643.         msg = ". . ."
  644.         game.Lighting.FogColor = Color3.fromRGB(0,0,0)
  645.         for i = 1,30 do
  646.             game.Lighting.FogEnd = (100000/2000)*(29-i) --100000 default
  647.             RunService.Heartbeat:Wait()
  648.         end
  649.         local jumptrap = Instance.new("Part")
  650.         jumptrap.Anchored = true
  651.         jumptrap.CanCollide = false
  652.         jumptrap.CastShadow = false
  653.         jumptrap.Transparency = 0.9
  654.         jumptrap.Size = Vector3.new(8,8,8)
  655.         Instance.new("Sparkles",jumptrap).Color = Color3.new(0,0,0)
  656.         playSFX("http://www.roblox.com/asset/?id=11956590",3,0.95)
  657.         jumptrap.Material = Enum.Material.ForceField
  658.         jumptrap.Shape = 0
  659.         jumptrap.BrickColor = BrickColor.Black()
  660.         jumptrap.Position = character.Head.Position
  661.         jumptrap.Parent = workspace
  662.         jumptrap.Touched:Connect(KinderSurprise)
  663.         for i = 1,30 do
  664.             game.Lighting.FogEnd = (100000/2000)*(i*5)  --100000 default
  665.             RunService.Heartbeat:Wait()
  666.         end
  667.         doing_magic = false
  668.         for i = 1,180*phase do
  669.             RunService.Heartbeat:Wait()
  670.             jumptrap.Transparency = math.cos(i/20)
  671.             jumptrap.Position = character.Head.Position + Vector3.new(10*math.sin(i/40),0,10*math.cos(i/40))
  672.         end
  673.         for i = 1,15 do
  674.             RunService.Heartbeat:Wait()
  675.             jumptrap.Transparency = jumptrap.Transparency/i
  676.             jumptrap.Size = jumptrap.Size - Vector3.new(0.4,0.4,0.4)
  677.         end
  678.         con_cool = false
  679.         jumptrap:Destroy()
  680.     end
  681. end)
  682.  
  683. local savedpos = Vector3.new(0,0,0)
  684.  
  685. function strike(pos)
  686.     local thunder = Instance.new("Part",workspace)
  687.     thunder.Material = Enum.Material.Neon
  688.     thunder.Size = Vector3.new(4,500,4)
  689.     thunder.CanCollide = false
  690.     thunder.CastShadow = false
  691.     thunder.Anchored = true
  692.     thunder.Position = pos
  693.  
  694.     local e = Instance.new("Explosion")
  695.     e.BlastRadius = math.random(1,4)
  696.     e.BlastPressure = 0
  697.     e.Position = pos
  698.     e.Visible = false
  699.     e.Hit:Connect(function(hit)
  700.         local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  701.         if hum ~= nil and hit.Parent.Name ~= player then
  702.             hum:TakeDamage(math.random(5,50))
  703.             if crit(1) == true and hit.Parent.Name ~= player then
  704.                 playSFX("rbxassetid://8789851536",5,1)
  705.                 hum:TakeDamage(math.huge)
  706.             end
  707.         end
  708.     end)
  709.     e.Parent = workspace
  710.  
  711.     local sound = Instance.new("Sound",thunder)
  712.     sound.Volume = 10
  713.     sound.SoundId = "rbxassetid://13048892034"
  714.     sound.PlayOnRemove = true
  715.     sound:Destroy()
  716.  
  717.     for i = 1,5 do
  718.         RunService.Heartbeat:Wait()
  719.         thunder.Transparency = i/5
  720.     end
  721.     thunder:Destroy()
  722.  
  723. end
  724.  
  725. t_Thunder = Instance.new("Tool",playerbin.Backpack)
  726. t_Thunder.RequiresHandle = false
  727. t_Thunder.Name = "PK Thunder (450 PSI)"
  728. t_Thunder.Activated:Connect(function()
  729.     if doing_magic == false and psi >= 450  then
  730.         doing_magic = true
  731.         msg = "Giygas tries PK Thunder!"
  732.         playSFX("rbxassetid://13048879322",10,1)
  733.         psi = psi - 450
  734.  
  735.         for i = 1,6 do
  736.  
  737.             local catch = workspace:GetChildren()
  738.             local caught = {}
  739.             for x = 1,#catch do
  740.                 if catch[x]:IsA("Model") and catch[x].Name ~= player then
  741.                     local hum = catch[x]:FindFirstChildOfClass("Humanoid")
  742.                     if hum  ~= nil and catch[x] ~= nil then
  743.                         if math.abs((catch[x]:WaitForChild("Head").Position - character.Head.Position).Magnitude) <= 128 then --test
  744.                             --savedpos = catch[x].Head.Position
  745.                             table.insert(caught, catch[x].Head.Position)
  746.                         end
  747.                     end
  748.                 end
  749.             end
  750.             wait(0.3)
  751.             for z = 1,#caught do
  752.                 local rand = math.random(-4,4)
  753.                 local rand2 = math.random(-4,4)
  754.                 strike(caught[z] + Vector3.new(rand,0,rand2))
  755.             end
  756.         end
  757.         msg = ". . ."
  758.         doing_magic = false
  759.     end
  760. end)
  761.  
  762. t_Rockin = Instance.new("Tool",playerbin.Backpack)
  763. t_Rockin.RequiresHandle = false
  764. t_Rockin.Name = "PSI Rockin ω (2000 PSI)"
  765. t_Rockin.Activated:Connect(function()
  766.     if doing_magic == false and psi >= 2000  then
  767.         doing_magic = true
  768.         msg = "Giygas tries PSI Rockin ω!"
  769.         playSFX("rbxassetid://13048879322",10,1)
  770.         psi = psi - 2000
  771.         wait(1)
  772.         msg = ". . ."
  773.         local s = Instance.new("Sound",character.PrimaryPart)
  774.         s.SoundId = "rbxassetid://13048868272"
  775.         s.Volume = 10
  776.         --Instance.new("DistortionSoundEffect",s)
  777.         s.PlayOnRemove = true
  778.         s:Destroy()
  779.         local bodyposition = Instance.new("BodyPosition",character.PrimaryPart)
  780.         bodyposition.Position = character.PrimaryPart.Position + Vector3.new(0,60,0)
  781.         --wait(5.5*(40/100))
  782.         for i = 1,3 do
  783.             local colors = {BrickColor.Blue(),BrickColor.Yellow(),BrickColor.Red()}
  784.  
  785.             local fx = Instance.new("Part")
  786.             fx.Shape = 0
  787.             fx.Anchored = true
  788.             fx.CanCollide = false
  789.             fx.CastShadow = false
  790.             fx.Material = Enum.Material.Neon
  791.             fx.Position = character.PrimaryPart.Position
  792.             fx.Parent = workspace
  793.             fx.BrickColor = colors[math.random(1,3)]
  794.             for x = 1,33 do
  795.                 RunService.Heartbeat:Wait()
  796.                 fx.Transparency = x/20
  797.                 fx.Size = fx.Size + Vector3.new(3,3,3)
  798.             end
  799.             fx:Destroy()
  800.         end
  801.         local ball = Instance.new("Part")
  802.         ball.CanCollide = false
  803.         ball.Shape = 0
  804.         ball.Material = Enum.Material.Neon
  805.         ball.Anchored = true
  806.         ball.CastShadow = false
  807.         ball.Position = character.PrimaryPart.Position
  808.         ball.Parent = workspace
  809.         for i = 1,170 do
  810.             RunService.Heartbeat:Wait()
  811.             ball.Size = ball.Size + Vector3.new(5,5,5)
  812.             if math.random(0,2) == 1 then
  813.                 ball.BrickColor = BrickColor.Red()
  814.             elseif math.random(0,2) == 2 then
  815.                 ball.BrickColor = BrickColor.Blue()
  816.             else
  817.                 ball.BrickColor = BrickColor.Yellow()
  818.             end
  819.             ball.Transparency = i/200
  820.             DamageHumanoids(i*5,math.random(5,25),3)
  821.         end
  822.         ball:Destroy()
  823.         bodyposition:Destroy()
  824.         wait(4/phase)
  825.         doing_magic = false
  826.     end
  827. end)
  828.  
  829. t_Teleport = Instance.new("Tool",playerbin.Backpack)
  830. t_Teleport.RequiresHandle = false
  831. t_Teleport.Name = "PK Teleport β (100 PSI)"
  832. t_Teleport.Activated:Connect(function()
  833.     if doing_magic == false and psi >= 150 then
  834.         doing_magic = true
  835.         msg = "Giygas tries PK Teleport β!"
  836.         playSFX("rbxassetid://13048879322",10,1)
  837.         psi = psi - 100
  838.         wait(1)
  839.         msg = ". . ."
  840.         playSFX("rbxassetid://5909720414",4,0.9)
  841.         character.PrimaryPart.CFrame = character.PrimaryPart.CFrame + character.PrimaryPart.CFrame.LookVector*math.random(0,128) --.new(math.random(0,196),30,math.random(0,196))
  842.         wait(1/phase)
  843.         doing_magic = false
  844.     end
  845. end)
  846.  
  847. local s_cooldown = false
  848.  
  849. t_Shield = Instance.new("Tool",playerbin.Backpack)
  850. t_Shield.RequiresHandle = false
  851. t_Shield.Name = "PK Shield (150 PSI)"
  852. t_Shield.Activated:Connect(function()
  853.     if doing_magic == false and psi >= 150 and s_cooldown == false then
  854.         doing_magic = true
  855.         msg = "Giygas tries PK Shield!"
  856.         playSFX("rbxassetid://13048879322",10,1)
  857.         psi = psi - 150
  858.         wait(1)
  859.         doing_magic = false
  860.         s_cooldown = true
  861.         msg = ". . ."
  862.         local f = Instance.new("ForceField",character)
  863.         f.Visible = false
  864.         local fx = Instance.new("Part",character.PrimaryPart)
  865.         fx.Position = character.PrimaryPart.Position
  866.         fx.CanTouch = false
  867.         fx.BrickColor = BrickColor.Red()
  868.         fx.Size = Vector3.new(0.5,0.5,0.5)     
  869.         fx.CanCollide = false
  870.         fx.Massless = true
  871.         local weld = Instance.new("WeldConstraint",fx)
  872.         weld.Part1 = character.PrimaryPart
  873.         weld.Part0 = fx
  874.         fx.Shape = 0
  875.         playSFX("rbxassetid://1158234981",10,1)
  876.         fx.Material = Enum.Material.ForceField
  877.         for i = 1,15 do
  878.             RunService.Heartbeat:Wait()
  879.             fx.Size = fx.Size + Vector3.new(1.5,1.5,1.5)
  880.         end
  881.         wait(2.5*phase)
  882.         for i = 1,15 do
  883.             RunService.Heartbeat:Wait()
  884.             fx.Size = fx.Size - Vector3.new(1.5,1.5,1.5)
  885.         end
  886.         s_cooldown = false
  887.         msg = "Giygas' shield wore off!"
  888.         fx:Destroy()
  889.         f:Destroy()
  890.     end
  891. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement