Guest User

Untitled

a guest
Jun 18th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.76 KB | None | 0 0
  1. --//Services
  2. local RunService = game:GetService("RunService")
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4. local TweenService = game:GetService("TweenService")
  5. local ServerStorage = game:GetService("ServerStorage")
  6. local Players = game:GetService("Players")
  7. --//Modules
  8. local Casting = require(game:GetService("ServerStorage").Modules.CheckCastingSkill)
  9. local CheckSkill = require(ServerStorage.Modules.CheckCanSkill)
  10. local Shield = require(game:GetService("ServerStorage").Modules.Shields)
  11. local LerpAP = require(game:GetService("ReplicatedStorage").Modules.LerpAPI)
  12. local Effects = require(ServerStorage.Modules.Effects)
  13. local Skills = require(script.Parent.Parent.Script.Skills)
  14. local DamageManager = require(ServerStorage.Modules.DamageManager)
  15. local Unstoppable = require(ServerStorage.GoodEffects.Unstoppable)
  16. local Metrics = {
  17.     ["LeftFoot"] = Vector3.new(-0.8999999999999915,-5.49,0),
  18.     ["LeftHand"] = Vector3.new(-2.7,-1.9,0),
  19.     ["LeftLowerArm"] = Vector3.new(-2.7,-0.8,0),
  20.     ["LeftLowerLeg"] = Vector3.new(-0.9,-4.3,0),
  21.     ["LeftUpperArm"] = Vector3.new(-2.7,0.3,0),
  22.     ["LeftUpperLeg"] = Vector3.new(-0.9,-2.9,0),
  23.     ["LowerTorso"] = Vector3.new(0,-1.8,0),
  24.     ["RightFoot"] = Vector3.new(0.9000000000000057,-5.5,0),
  25.     ["RightHand"] = Vector3.new(2.700000000000003,-1.9,0),
  26.     ["RightLowerArm"] = Vector3.new(2.700000000000003,-0.8,0),
  27.     ["RightLowerLeg"] = Vector3.new(0.9000000000000057,-4.3,0),
  28.     ["RightUpperArm"] = Vector3.new(2.700000000000003,0.3,0),
  29.     ["RightUpperLeg"] = Vector3.new(0.9000000000000057,-2.9,0),
  30.     ["UpperTorso"] = Vector3.new(0,0,0),
  31.     ["Head"] = Vector3.new(0,2.3,0)
  32. }
  33.  
  34. local UltraS = {}
  35.  
  36.     UltraS.__index = UltraS
  37.  
  38.     function UltraS.New(player,T,D,slot,Stage,cd)
  39.        if Stage == 2 then
  40.           Casting.RemoveCast(player.UserId,0)
  41.           Skills.Cooldown(player,0,"UltraShield",slot)
  42.        else    
  43.           local newUltra = {}
  44.           setmetatable(newUltra,UltraS)
  45.           newUltra.Name = "UltraShield"
  46.           newUltra.Stage = 1
  47.           newUltra.OldCharacter = Instance.new("Folder",ServerStorage)
  48.           newUltra.Slot = slot
  49.           newUltra.Player = player
  50.           newUltra.OldCharacter.Name = newUltra.Player.Name
  51.           newUltra.Model = ReplicatedStorage.Skills.Elemental.UltraShield.Meshes.Model:Clone()
  52.           newUltra.Model.Name = player.Name.." UltraShield"
  53.           newUltra.Model.Parent = workspace
  54.           newUltra.Cooldown = cd
  55.           return newUltra
  56.        end  
  57.     end
  58.  
  59.    function UltraS:GetVectorFromCFrame(cf)
  60.     local VectorC = Vector3.new(cf.X,cf.Y,cf.Z)
  61.     return VectorC
  62.   end
  63.  
  64.  
  65.    function UltraS:Build()
  66.      if self.Stage == 2 then
  67.         for i,v in pairs(self.Player.Character:GetChildren()) do
  68.             if v:IsA("MeshPart")then
  69.                if v.Name~='HumanoidRootPart' then
  70.                    local Clone = v:Clone() 
  71.                    Clone:ClearAllChildren()
  72.                    Clone.Parent = self.Model
  73.                    Clone.Anchored = false  
  74.                    Clone.CanCollide = false
  75.                    Clone.CastShadow = false
  76.                    Clone.Transparency = 0.8
  77.                    Clone.Material = Enum.Material.Neon
  78.                    local Motor = Instance.new("Motor6D",self.Model)
  79.                    --local Weld = Instance.new("Weld",self.Model)
  80.                    Motor.Part0 = Clone
  81.                    Motor.Part1 = v
  82.                    --Weld.Part0 = Clone
  83.                    --Weld.Part1 = v
  84.                    Clone.Size = Clone.Size * Vector3.new(2.8,2.8,2.8)  
  85.                    Clone.Position = v.Position + Metrics[""..v.Name]                                       
  86.                end
  87.             elseif v.Name == "Head" then
  88.                 local Clone = v:Clone()
  89.                    Clone:ClearAllChildren()
  90.                    Clone.Parent = workspace
  91.                    Clone.Anchored = false  
  92.                    Clone.CanCollide = false
  93.                    Clone.CastShadow = false
  94.                    Clone.Transparency = 0.8
  95.                    Clone.Material = Enum.Material.Neon
  96.                    local Weld = Instance.new("Weld",self.Model)
  97.                    Weld.Part0 = Clone
  98.                    Weld.Part1 = v
  99.                    Clone.Size = Clone.Size * Vector3.new(2.8,2.8,2.8)  
  100.                    Clone.Position = v.Position + Metrics[""..v.Name]
  101.             end
  102.            
  103.         end
  104.         self.Player.Character:WaitForChild("Humanoid").HipHeight = 8
  105.              
  106.      elseif self.Stage == 0 then
  107.        
  108.      end
  109.    end
  110.  
  111.    function UltraS:CreateEffects()
  112.      if self.Stage == 1 then
  113.         self.Stage = 2
  114.         coroutine.wrap(function()
  115.         for i = 0, 1, 1/30 do
  116.             self.Player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(LerpAP.Lerp(self:GetVectorFromCFrame(self.Player.Character:WaitForChild("HumanoidRootPart").CFrame),Vector3.new(self.Player.Character:WaitForChild("HumanoidRootPart").CFrame.X,self.Player.Character:WaitForChild("HumanoidRootPart").CFrame.Y + 8, self.Player.Character:WaitForChild("HumanoidRootPart").CFrame.Z),i))
  117.             RunService.Heartbeat:Wait()
  118.         end
  119.         end)()
  120.         self:Build()
  121.      elseif self.Stage == 2 then
  122.         self.Stage = 0
  123.         --self:Build()
  124.     end
  125.    end
  126.  
  127.    function UltraS:CanFire()
  128.      if self.Stage == 1 then
  129.         self:CreateEffects()
  130.      elseif self.Stage == 2 then
  131.         self:CreateEffects()
  132.      end
  133.    end
  134.  
  135. return UltraS
Add Comment
Please, Sign In to add comment