How To Make Sword Combat | Part 4 | Roblox Studio

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 มิ.ย. 2024
  • Script On Comments
    I Kinda Like To Add More Mechanics For The Combat But Since We're Using SimpleCombat System, it's Kinda bad, so yeah, else if you want messy code i'll be doing it
  • เกม

ความคิดเห็น • 14

  • @Sen23456
    @Sen23456  หลายเดือนก่อน +1

    --Script--
    local Attributes = script.Parent.Parent.Parent.Attributes
    local Damage = Attributes.Damage.Value
    local Cooldown = Attributes.Cooldown.Value
    local CanAttack = true
    local Combo = 1
    local ComboDone = 0
    local Debris = game:GetService("Debris")
    local function Damaged(Target)
    local BoolValue = Instance.new("BoolValue",Target)
    BoolValue.Name = "Damaged"
    BoolValue.Value = true
    Debris:AddItem(BoolValue,0.55)
    end
    local function Stunned(Target)
    local Stunned = Instance.new("BoolValue")
    Stunned.Name = "Stunned"
    Stunned.Value = true
    Debris:AddItem(Stunned,0.55)
    end
    script.Parent.OnServerEvent:Connect(function(player)
    local char = player.Character
    local Hum = char:WaitForChild("Humanoid")
    local Root = char:WaitForChild("HumanoidRootPart")

    if CanAttack == false or char:FindFirstChild("Stunned") then return end
    CanAttack = false
    ComboDone = ComboDone + 1

    if Combo == 1 then
    local anim = script.Swing1
    local PlayAnim = Hum:LoadAnimation(anim)
    PlayAnim:Play()
    Combo = 2
    elseif Combo == 2 then
    local anim = script.Swing2
    local PlayAnim = Hum:LoadAnimation(anim)
    PlayAnim:Play()
    Combo = 1
    end

    delay(0.10,function()
    Hum.WalkSpeed = 0.1
    Hum.JumpPower = 0
    delay(0.15,function()
    Hum.WalkSpeed = 16
    Hum.JumpPower = 50
    end)
    end)

    if ComboDone == 6 then
    ComboDone = 0
    end

    delay(0.15,function()
    local Hitbox = Instance.new("Part",char)
    Hitbox.Size = Vector3.new(4, 5.479, 4.396)
    Hitbox.CFrame = Root.CFrame + Root.CFrame.LookVector * 2
    Hitbox.Transparency = 1
    Hitbox.CanCollide = false
    Hitbox.Anchored = true

    Hitbox.Touched:Connect(function(hit)
    local Echar = hit.Parent
    local EHum = Echar:FindFirstChild("Humanoid")
    if Echar:FindFirstChild("Humanoid") and Echar.Name ~= char.Name then
    if Echar:FindFirstChild("Damaged") then return end
    Damaged(Echar)
    if Echar:FindFirstChild("isBlocking").Value == true then
    EHum:TakeDamage(Damage/2)
    else
    local Anim = script.Stun
    local PlayAnim = EHum:LoadAnimation(Anim)
    PlayAnim:Play()
    EHum:TakeDamage(Damage)
    Stunned(Echar)

    if ComboDone == 5 then
    local Pos = Root.CFrame * CFrame.new(0,0,-26)
    local BP = Instance.new("BodyPosition")
    BP.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
    BP.D = 90
    BP.P = 400
    BP.Position = Pos.p
    BP.Parent = Echar:FindFirstChild("HumanoidRootPart")
    game.Debris:AddItem(BP,0.4)
    end
    end
    Hitbox:Destroy()
    end
    end)
    delay(0.18,function()
    Hitbox:Destroy()
    end)
    end)

    task.wait(Cooldown)
    CanAttack = true
    end)

  • @marinegaming6933
    @marinegaming6933 หลายเดือนก่อน +1

    Absolutely no idea why this is in my recommended but this is pretty useful. Thank you!

  • @rixovertig
    @rixovertig หลายเดือนก่อน +1

    keep going

    • @Sen23456
      @Sen23456  หลายเดือนก่อน +1

      will do

  • @rixovertig
    @rixovertig หลายเดือนก่อน +1

    please continue this series because im going on with you, also how many more parts are you gonna do?

    • @Sen23456
      @Sen23456  หลายเดือนก่อน

      probably 6 episodes

  • @BlazeSparkAutoDetailing
    @BlazeSparkAutoDetailing 13 วันที่ผ่านมา

    I need help, whenever i try to attack the dummy my game is paused for rendering and theres an error on line 72 saying that ("isBlocking") is a nil and i cant use ("isBlocking").Value

  • @duckbusiness9524
    @duckbusiness9524 หลายเดือนก่อน +1

    Can u make tutorial about how to make a katana flash dash skill (tool) like thunder clap from demon slayer

    • @Sen23456
      @Sen23456  หลายเดือนก่อน +1

      why not

    • @duckbusiness9524
      @duckbusiness9524 หลายเดือนก่อน +1

      @@Sen23456 yessirrrrrr

  • @raykilla.
    @raykilla. หลายเดือนก่อน +1

    how do you give yourself the sword w the animations ect?

    • @Sen23456
      @Sen23456  หลายเดือนก่อน +1

      for animations create your own animation and the sword is free model

    • @raykilla.
      @raykilla. หลายเดือนก่อน

      @@Sen23456 do you got discord?

    • @Sen23456
      @Sen23456  หลายเดือนก่อน

      yeah
      User: SenTheCoder#0824