Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ThunderClap = {}
- local DISTANCE_FLASHED = 50
- local DELAY = 2
- local HITBOX_SIZE = Vector3.new(10, 10, DISTANCE_FLASHED + 5)
- local HITBOX_LIFE = DELAY + .3
- local ATTACHMENT_SIZE = Vector3.one
- local function ToggleStats(self, Player, Type)
- local Humanoid = Player.Character:FindFirstChild("Humanoid")
- local Data = {
- [true] = {
- Freeze = true,
- Look = false,
- AutoRotate = false,
- WalkSpeed = 0
- },
- [false] = {
- Freeze = false,
- Look = true,
- AutoRotate = true,
- WalkSpeed = self.DataStore:GetData(Player, "WalkSpeed")
- }
- }
- local GivenTable = Data[Type]
- self.DataStore:SetData(Player, "Freeze", GivenTable.Freeze)
- self.DataStore:SetData(Player, "Look", GivenTable.Look)
- Humanoid.AutoRotate = GivenTable.AutoRotate
- Humanoid.WalkSpeed = GivenTable.WalkSpeed
- end
- ThunderClap.Hit = {
- Damage = 10,
- Stamina = 0,
- Blockable = false,
- }
- function ThunderClap:HitEffects(Attacker, Victim, Hitbox)
- local HumRP = Victim:FindFirstChild("HumanoidRootPart")
- HumRP.AssemblyLinearVelocity = Hitbox.CFrame.LookVector * 10
- self.Physics:Ragdoll(Victim, 3)
- end
- function ThunderClap:FireSkill(Player)
- local Character = Player.Character
- local Humanoid, HumRP = Character:FindFirstChild("Humanoid"), Character:FindFirstChild("HumanoidRootPart")
- local StartPosition = HumRP.Position
- local EndPosition = HumRP.Position + HumRP.CFrame.LookVector * DISTANCE_FLASHED
- local MiddlePosition = (StartPosition + EndPosition) / 2
- local Thunder = HumRP:FindFirstChild("Thunder")
- local Dust = script:FindFirstChild("DustEffect"):Clone()
- local HitboxArgs = {Size = HITBOX_SIZE, Life = HITBOX_LIFE, Lineage = script, Attacker = Character}
- local BoltAttachments = {}
- local Hitbox = self.Shared:CreateHitbox(Character, HitboxArgs)
- HitboxArgs.Color = Color3.new(0, 0, 0)
- HitboxArgs.Size = HITBOX_SIZE
- local DustEmission = self.Shared:CreatePart(StartPosition + Vector3.new(0, .5, 0))
- Dust.Parent = DustEmission
- for Counter = 1, 2 do
- BoltAttachments["Attach"..tostring(Counter)] = self.Shared:CreatePart()
- end
- Hitbox.Position = MiddlePosition
- Hitbox.CFrame = CFrame.lookAt(Hitbox.Position, EndPosition)
- --self.Shared:CreateWeld(Hitbox, HumRP)
- BoltAttachments["Attach1"].Position = StartPosition
- BoltAttachments["Attach2"].Position = EndPosition
- -- Pre-Thunder Clap
- print("Charging..")
- ToggleStats(self, Player, true)
- task.wait(DELAY / 2)
- --Just-Before Thunder Clap
- self["Effects"].Rubble:CreateRubble(3, Character)
- task.wait(DELAY / 4)
- -- Thunder Clap
- print("Thunder Clap and FLash! Re-cooperating..")
- Hitbox.Parent = workspace
- Dust:Emit(40)
- for Name, Part in pairs(BoltAttachments) do
- local Attachment = Instance.new("Attachment")
- Attachment.Name = Part.Name.."Attach"
- Attachment.Parent = Part
- Part.Parent = workspace
- BoltAttachments[Name] = Attachment
- end
- local BlueBoltSettings = {
- Attach1 = BoltAttachments.Attach1,
- Attach2 = BoltAttachments.Attach2,
- PartCount = 50,
- CurveSize0 = math.random(10, 15),
- CurveSize1 = math.random(10, 15),
- PulseSpeed = math.random(5, 10),
- PulseLength = 1,
- FadeLength = .1,
- MaxRadius = 2,
- Color = Color3.new(0.0901961, 0.72549, 1)
- }
- local YellowBoltSettings = {
- Attach1 = BoltAttachments.Attach1,
- Attach2 = BoltAttachments.Attach2,
- PartCount = 50,
- CurveSize0 = math.random(15, 20),
- CurveSize1 = math.random(15, 20),
- PulseSpeed = math.random(5, 10),
- PulseLength = 1,
- FadeLength = .1,
- MaxRadius = 10,
- Color = Color3.new(0.807843, 1, 0.184314)
- }
- self.Shared:CreateBolt(BlueBoltSettings)
- self.Shared:CreateBolt(YellowBoltSettings)
- self.Shared:CreateBolt(YellowBoltSettings)
- Thunder:Play()
- self.Shared:PlayTween(HumRP, TweenInfo.new(.1 , Enum.EasingStyle.Quart), {Position = EndPosition})
- self.Shared["ClientServer"]:FireClient(Player, "CameraHandler", "ShakeCamera", "Explosion")
- --Post Thunder Clap
- task.wait(DELAY)
- ToggleStats(self, Player, false)
- print("Finished.")
- task.wait(2)
- self.Physics:Ragdoll(Character, true)
- end
- return ThunderClap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement