Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local BasicAttack = game:GetService("ReplicatedStorage").RemoteFunctions:FindFirstChild("WeaponRemotes").ZangetsuRemotes["BasicAttack"]
- local Assets = game:GetService("ReplicatedFirst"):WaitForChild("Assets")
- BasicAttack.OnServerEvent:Connect(function(player)
- player.Character.holder.Clashing.Value = true
- ----------------------------------------------------Variables
- local Sword = player.Character.Tool.Blade
- local clash = Instance.new('BodyVelocity')
- local root = player.Character.HumanoidRootPart
- local hitbox = Instance.new("Part")
- local name = player.Name
- local folder = game:GetService("ReplicatedStorage"):FindFirstChild(name)
- local Kendo = folder.Stats.Kendo
- local debounce = {};
- ----------------------------------------------------Hitbox
- hitbox.Name = "Hitbox"
- hitbox.Parent = game.Workspace
- hitbox.CFrame = Sword.CFrame
- hitbox.CanCollide = false
- hitbox.Size = Vector3.new(10,2,1)
- hitbox.Transparency = 0.5
- hitbox.BrickColor = BrickColor.new("Really red")
- ---------------------------------------------------Welding
- local w1 = Instance.new("Weld", Sword)
- w1.Part0 = Sword
- w1.Part1 = hitbox
- w1.C0 = CFrame.Angles(0,0,5)
- w1.C1 = CFrame.new(0,-0.3,0)
- --------------------------------------------------Damage
- hitbox.Touched:Connect(function(hit)
- local dmg = math.floor(Kendo.Value/ 1.15 + math.random(1,5))
- local enemyWeapon = hit.Parent:FindFirstChild('Hitbox')
- local opponent = hit.Parent:FindFirstChild("Humanoid")
- local hostileWeapon = hit.Name
- if opponent ~= player.Character:FindFirstChild("Humanoid") and hit.Parent.Name ~= "Hitbox" or hit.Parent.Name ~= "Blade" then
- opponent:TakeDamage(dmg)
- ------------------------------------------------------
- -----------------[Text/Gui and debounce]---------------------------
- local effect = Instance.new("BillboardGui", opponent.Parent.Head)
- effect.Size = UDim2.new(1,0,1,0)
- wait()
- local text = Instance.new("TextBox")
- text.Parent = effect
- text.TextSize = 60
- text.TextColor3 = Color3.new(255,255,255)
- text.TextStrokeColor3 = Color3.new(95,0,0)
- text.TextStrokeTransparency = 0
- text.Font = "Cartoon"
- text.BackgroundTransparency = 1
- text.Size = UDim2.new(1,0,1,0)
- text.Text = dmg
- wait(0.5)
- effect:remove()
- elseif hostileWeapon == 'Hitbox' or hostileWeapon == "Blade" then
- clash.Parent = root
- clash.maxForce = Vector3.new(1e8,1e8,1e8)
- clash.Velocity = root.CFrame.lookVector*-60
- wait()
- clash.Velocity = Vector3.new(0,0,0)
- clash:remove()
- else
- print(hit.Name)
- end
- end)
- wait(0.85)
- hitbox:remove()
- wait(0.5)
- player.Character.holder.Clashing.Value = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement