How To Make Sword Combat | Part 1 | Roblox Studio

Поділитися
Вставка
  • Опубліковано 12 чер 2024
  • Script Will Be On The Comment Section
  • Ігри

КОМЕНТАРІ • 17

  • @Sen23456
    @Sen23456  12 днів тому +1

    --[[local Script]]--
    local Tool = script.Parent
    Tool.Activated:Connect(function()
    script.SwordCombatRemote:FireServer("Attack")
    end)
    --[[Server Script]]--
    local Attributes = script.Parent.Parent.Parent.Attributes
    local Damage = Attributes.Damage.Value
    local Cooldown = Attributes.Cooldown.Value
    local CanAttack = true
    local Combo = 1
    script.Parent.OnServerEvent:Connect(function(player)
    local char = player.Character
    local Hum = char:WaitForChild("Humanoid")
    local Root = char:WaitForChild("HumanoidRootPart")

    if not CanAttack then return end
    CanAttack = false

    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

    wait(Cooldown)
    CanAttack = true
    end)

  • @CowBoyKid-uk5lx
    @CowBoyKid-uk5lx 10 днів тому +3

    Great tutorial! keep up the good work

  • @Mr4DMAGNUM
    @Mr4DMAGNUM 12 днів тому +1

    Coool

  • @xxbloxsuperx9746
    @xxbloxsuperx9746 10 днів тому +1

    Ty

  • @MichaelKay-lt8yu
    @MichaelKay-lt8yu 6 днів тому +1

    A can't get the animation to work.

    • @Sen23456
      @Sen23456  6 днів тому +1

      There Ain't No Way It Doesn't work watch the tutorial and get the script on pinned comment

  • @Ofukunikasex
    @Ofukunikasex 8 днів тому +1

    I made 4 animations can I still use this?

    • @Sen23456
      @Sen23456  7 днів тому +1

      Yes You can, just add some variables like if
      combo == 2 then
      combo = 3
      if combo == 3 then
      combo == 1
      some thing like that

    • @Ofukunikasex
      @Ofukunikasex 7 днів тому +1

      @@Sen23456 I can not lie this didn’t work

    • @Sen23456
      @Sen23456  6 днів тому +1

      it's an example code.. if it didn't work check the output what's missing and what's the problem

  • @Andrialomi
    @Andrialomi 7 днів тому +1

    how do i get the sword to get in my inventory automatically?

    • @Sen23456
      @Sen23456  6 днів тому +1

      do you mean equipped? i can help you with that just create a script when player and character is added find the humanoid and use humanoid:EquipTools(YourToolName)

    • @Andrialomi
      @Andrialomi 6 днів тому +1

      i dont know how to find a humanoid can u give me a full script for the equip? i typed the humanoid:EquipTools(Sword)
      but it didnt work because humanoid was unkown.

    • @Sen23456
      @Sen23456  5 днів тому +1

      no full scripts.. but you gotta index all of it.. if you are new on development it might be tough
      local char = game:GetServce("Players").LocalPlayer.Character
      local Humanoid = char:WaitForChild("Humanoid")
      Humanoid:EquipTools(YourSwordName)
      there are informations about this on dev forums

  • @xanstraincvkuro8707
    @xanstraincvkuro8707 7 днів тому +1

    SONG NAME?

    • @Sen23456
      @Sen23456  6 днів тому +1

      i don't know either i just found it on Xenesr outro 😭😭