How To Make A Fighting Game Punch Script | Roblox Studio Tutorial

Поділитися
Вставка
  • Опубліковано 11 січ 2025

КОМЕНТАРІ • 2,2 тис.

  • @MajesticUC
    @MajesticUC  Рік тому +158

    If you have any problems, feel free to ask me about them!

    • @theunknowgold2284
      @theunknowgold2284 Рік тому +2

      do you have discord server?

    • @MajesticUC
      @MajesticUC  Рік тому +9

      Yes, I linked it in another video

    • @Neptoon_dev
      @Neptoon_dev Рік тому +7

      Do you have a tutorial to add particles to the punches

    • @MajesticUC
      @MajesticUC  Рік тому +10

      I could make one

    • @propergato
      @propergato Рік тому +2

      @@MajesticUC make it I need lol

  • @dusk2019
    @dusk2019 Рік тому +21

    a sick video, had exactly what I was looking for and some BANGER music!

  • @TheRealTiger0
    @TheRealTiger0 Рік тому +92

    to add sound use this script
    local sound = script.YOURSOUNDHERE:Clone()
    sound.Parent = hit.Parent:FindFirstChild("Humanoid")
    sound:Play()
    game.Debris:AddItem(sound,2)
    note:put it after the TakeDamage function
    also make sure to put the sound of ur choice in the script AND put the name of the sound at the script.YOURSOUNDHERE part
    and the game.Debris thing make the sound,2 and the number of how long the sound is
    now this is how to add particles:
    local punchParticle = game.ReplicatedStorage["PARTICLE PART NAME"].Attachment:Clone()
    punchParticle.Parent = hit.Parent:FindFirstChild("HumanoidRootPart")
    for i, v in pairs(punchParticle:GetChildren()) do
    if v:IsA("ParticleEmitter") then
    v:Emit(30)
    game.Debris:AddItem(punchParticle,0.4)
    end
    end
    if u did the sound w/ me then put it after the game.Debris:AddItem(sound,2)
    if u didnt do that do it after the TakeDamage function
    name the particle part name to the vfx ur using
    add a part put an atttachment in it then put the particle emitters in it
    then put the part into replicated storage
    the game.Debris:AddItem(punchParticle,0.4) so change the 0.4 to how long the particle is
    and I’m still waiting on that moblie support😅

    • @n1runReal
      @n1runReal 11 місяців тому

      im having a error in the sound part

    • @TheRealTiger0
      @TheRealTiger0 11 місяців тому

      @@n1runRealwhat was the error?

    • @n1runReal
      @n1runReal 11 місяців тому

      @@TheRealTiger0 i exactly couldnt understand in the console but in the script the "hit" part in the hit.parent and stuff was underlined red

    • @TheRealTiger0
      @TheRealTiger0 11 місяців тому

      So like hit.Parent is like i think whoever you hit parent so maybe like idk just check the TUTORIALS scripts again or maybe you didn’t put it after the Damage function? Like the humanoid:TakeDamage() thing

    • @n1runReal
      @n1runReal 11 місяців тому

      @@TheRealTiger0 i did put it after it, do i have to remove the "end)" after the fuction?

  • @ABYYSpm
    @ABYYSpm Рік тому +192

    Out of all the developers making combat systems, I gotta say, this is the only developer who took his time to explain his code and doesn’t use unnecessary code or tells you to just copy his code. It took me 2 hours to learn this and I am grateful. Keep it up man thanks a lot❤

    • @MajesticUC
      @MajesticUC  Рік тому +22

      This code isnt the greatest if im gonna be 100% honest! I might remake this combat system tutorial just cos this one isnt very secure at all!!!

    • @_North
      @_North Рік тому +2

      He didn't explain the code, he explained what the code did after it was executed. If you really want to learn something from this video, you have to be slightly more advanced to understand the actual functions and components of the script.

    • @ADquality.
      @ADquality. Рік тому +1

      Omg thanks for sharing I was looking for a dev that won’t ask to copy their code Tysm to u and the ytber (dev)

    • @DaBeastGang
      @DaBeastGang Рік тому +1

      Hey man I know your trying, but this tutorial is not descriptive enough for beginners.

    • @ChubsterFX
      @ChubsterFX Рік тому

      @@MajesticUCyeah it sucks

  • @lazermaven4870
    @lazermaven4870 Рік тому +48

    for anyone who wants to change the damage, what you want to do is, on line 35 of the hitbox script, you wanna do this:
    1. go to the script(hitbox)
    2. go to line 35
    3. at the end of line 35 in the parathesis put (damage + "number of your choice")
    and test it on a dummy to see if it works
    You're welcome!
    Edit: i'd say do a higher number

    • @Night_YTistaken
      @Night_YTistaken Рік тому +2

      and if you don't deal any damage at all, then what?

    • @lazermaven4870
      @lazermaven4870 Рік тому +1

      @@Night_YTistaken
      :)

    • @lazermaven4870
      @lazermaven4870 Рік тому +1

      @Night_YTistaken
      I haven't try this but try (damage - "number") and test it, idk if it'll make it 0 so try multiple numbers until it does 0. Your welcome if it works!

    • @Night_YTistaken
      @Night_YTistaken Рік тому +1

      @@lazermaven4870 ye sorry i forgot to say that i fixed it but thx

    • @lazermaven4870
      @lazermaven4870 Рік тому +1

      ​@@Night_YTistakenWc 😊

  • @Candibr
    @Candibr Рік тому +6

    Thank you very much MajesticDev, I finally learned how to make a combat for my game, really, thank you very much, I've become a big fan of yours. Your channel was the only one that got me right! I love you from the heart.

    • @MajesticUC
      @MajesticUC  Рік тому +1

      Glad I could help!

    • @Iniknite
      @Iniknite 5 місяців тому

      @@MajesticUC the punch animation isnt playing

  • @JoshuaA.Montgomery
    @JoshuaA.Montgomery Рік тому +8

    Man I love ur Vids they bring me so much joy as a new person to roblox studios

  • @gelidus1765
    @gelidus1765 Рік тому +16

    Very helpful! Thank you for this great tutorial, i modified it a bit and now it's perfect, i like it so far!

    • @MajesticUC
      @MajesticUC  Рік тому +5

      Glad it helped!

    • @HaniEK.
      @HaniEK. 6 місяців тому

      @@MajesticUC it didnt work for me and i dont know whats the problem

  • @Neptoon_dev
    @Neptoon_dev Рік тому +12

    Wow this is the smoothest open source punch script I’ve ever Sean thank you

  • @chrisrey0018
    @chrisrey0018 15 днів тому

    works great, glad i learned the basics first, makes it much better to understand

  • @NOOB-bk9qr
    @NOOB-bk9qr Рік тому +100

    local cas = game:GetService("ContextActionService")
    local rs = game:GetService("ReplicatedStorage")

    local events = rs:WaitForChild("Events")
    local hitboxEvent = events:WaitForChild("Hitbox")

    local plr = game.Players.LocalPlayer
    local character = plr.Character or plr.CharacterAdded:Wait()
    local hum = character:WaitForChild("Humanoid")
    local animator = hum:WaitForChild("Animator")

    local leftPunch = animator:LoadAnimation(script:WaitForChild("LeftPunch"))
    local rightPunch = animator:LoadAnimation(script:WaitForChild("RightPunch"))

    local currentPunch = 0
    local lastPunch = 0

    local debounce = false

    local function punch()
    if debounce then return end
    if tick() - lastPunch > 1.5 then
    currentPunch = 0
    end

    debounce = true
    if currentPunch == 0 then
    rightPunch:Play()
    hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3)
    task.wait(0.4)
    debounce = false
    elseif currentPunch == 1 then
    leftPunch:Play()
    hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3)
    task.wait(0.4)
    debounce = false
    elseif currentPunch == 2 then
    rightPunch:Play()
    hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3)
    task.wait(0.8)
    debounce = false
    end
    if currentPunch == 2 then
    currentPunch = 0
    else
    currentPunch += 1
    end
    lastPunch = tick()
    end

    cas:BindAction("Punch", punch, true, Enum.UserInputType.MouseButton1)



    -- SERVER SCRIPT ------------------------------------------------------------------


    local rs = game:GetService("ReplicatedStorage")

    local events = rs:WaitForChild("Events")
    local hitboxEvent = events:WaitForChild("Hitbox")

    function newHitbox(character, size, offset, damage, linger)
    local hrp = character:FindFirstChild("HumanoidRootPart")
    if hrp == nil then return end
    local weld = Instance.new("WeldConstraint", hrp)
    local hitbox = Instance.new("Part")
    weld.Part0 = hrp
    weld.Part1 = hitbox

    hitbox.Transparency = 1
    hitbox.CanCollide = false
    hitbox.CanQuery = false
    hitbox.Massless = true

    hitbox.Size = size
    hitbox.CFrame = hrp.CFrame + hrp.CFrame.LookVector * offset.X + Vector3.new(0,offset.Y)
    hitbox.Parent = character

    hitbox.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") == nil then return end

    for _, v in pairs(hitbox:GetChildren()) do
    if v:IsA("ObjectValue") then
    if v.Value == hit.Parent then return end
    end
    end

    local hitCounter = Instance.new("ObjectValue", hitbox)
    hitCounter.Value = hit.Parent

    hit.Parent.Humanoid:TakeDamage(damage)
    end)

    game.Debris:AddItem(hitbox, linger)
    end

    hitboxEvent.OnServerEvent:Connect(function(plr, size, offset, damage, linger)
    newHitbox(plr.Character, size, offset, damage, linger)
    end)
    Edit: Also yes, I stole it from the paste bin.

  • @dbzfan81
    @dbzfan81 Рік тому +21

    i'll use this as reference since i've been trying to make a combat system with remote events, local scripts and scripts but it always bugged, thank you for uploading this since i had no consideration for bind action before this!!!

  • @PAPYRUSTHEROYALGUARDSMAN
    @PAPYRUSTHEROYALGUARDSMAN Рік тому +3

    you helped so much with my fighting game and the tutorial is so short too!

  • @RZ_Legend377
    @RZ_Legend377 9 місяців тому +6

    PunchScript (Localscript):
    local cas = game:GetService("ContextActionService")
    local rs = game:GetService("ReplicatedStorage")
    local events = rs:WaitForChild("Events")
    local hitboxEvent = events:WaitForChild("Hitbox")
    local plr = game.Players.LocalPlayer
    local character = plr.Character or plr.CharacterAdded:Wait()
    local hum = character:WaitForChild("Humanoid")
    local animator = hum:WaitForChild("Animator")
    local leftPunch = animator:LoadAnimation(script:WaitForChild("LeftPunch"))
    local rightPunch = animator:LoadAnimation(script:WaitForChild("RightPunch"))
    local currentPunch = 0
    local lastPunch = 0
    local debounce = false
    local function punch()
    if debounce then return end
    if tick() - lastPunch> 1.5 then
    currentPunch = 0
    end
    debounce = true
    if currentPunch == 0 then
    rightPunch:Play()
    hitboxEvent:FireServer(Vector3.new(4,4,4), Vector3.new(2), 10, 0.3)
    task.wait(0.4)
    debounce = false
    elseif currentPunch == 1 then
    leftPunch:Play()
    hitboxEvent:FireServer(Vector3.new(4,4,4), Vector3.new(2), 10, 0.3)
    task.wait(0.4)
    debounce = false
    elseif currentPunch == 2 then
    rightPunch:Play()
    hitboxEvent:FireServer(Vector3.new(4,4,4), Vector3.new(2), 10, 0.3)
    task.wait(0.8)
    debounce = false
    end
    print(currentPunch)
    if currentPunch == 2 then
    currentPunch = 0
    else
    currentPunch += 1
    end
    lastPunch = tick()
    end
    cas:BindAction("Punch", punch, true, Enum.UserInputType.MouseButton1)
    ServerScript (Normal Script):
    local rs = game:GetService("ReplicatedStorage")
    local events = rs:WaitForChild("Events")
    local hitboxEvent = events:WaitForChild("Hitbox")
    function newHitbox(character, size, offset, damage, linger)
    local hrp = character:FindFirstChild("HumanoidRootPart")
    if hrp == nil then return end
    local weld = Instance.new("WeldConstraint", hrp)
    local hitbox = Instance.new("Part")
    weld.Part0 = hrp
    weld.Part1 = hitbox

    hitbox.Transparency = 1
    hitbox.CanCollide = false
    hitbox.CanQuery = false
    hitbox.Massless = true

    hitbox.Size = size
    hitbox.CFrame = hrp.CFrame + hrp.CFrame.LookVector * offset.X + Vector3.new(0,offset.Y)
    hitbox.Parent = character

    hitbox.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") == nil then return end

    for _, v in pairs(hitbox:GetChildren()) do
    if v:IsA("ObjectValue") then
    if v.Value == hit.Parent then return end
    end
    end

    local hitCounter = Instance.new("ObjectValue", hitbox)
    hitCounter.Value = hit.Parent

    hit.Parent.Humanoid:TakeDamage(damage)
    end)

    game.Debris:AddItem(hitbox, linger)
    end
    hitboxEvent.OnServerEvent:Connect(function(plr, size, offset, damage, linger)
    newHitbox(plr.Character, size, offset, damage, linger)
    end)

    • @Doggydog-s5f
      @Doggydog-s5f 2 місяці тому

      thx so much life saviour

    • @Lyrics4LifeOfficial
      @Lyrics4LifeOfficial 2 місяці тому +1

      Thanks you're amazing

    • @RZ_Legend377
      @RZ_Legend377 2 місяці тому +1

      @@Lyrics4LifeOfficial no problem bro

    • @wchui27
      @wchui27 7 днів тому

      Can someone tell me why the second punch keeps repeating

  • @nova-xw3cm
    @nova-xw3cm Рік тому +1

    yo this was so helpful and straight to the point.
    You just earned urself a sub my guy.

  • @RedHat11111
    @RedHat11111 10 місяців тому +1

    earned a sub thanks making my new fighting game rn :DDD

  • @Donimn
    @Donimn Рік тому +14

    EVERYONE STRUGGELING TO MAKE THE PUNCH DO MORE DAMAGE HERE!!!:::
    CHANGE THE PART WHERE IT SAYS TAKADAMAGE(100) TO THE AMOUNT YOU WANT!
    BTW:THIS IS THE HITBOX SCRIPT
    local rs = game:GetService("ReplicatedStorage")
    local events = rs:WaitForChild("Events")
    local hitboxEvent = events:WaitForChild("Hitbox")
    function newHitbox(character, size, offset, damage, linger)
    local hrp = character:FindFirstChild("HumanoidRootPart")
    if hrp == nil then return end
    local weld = Instance.new("WeldConstraint", hrp)
    local hitbox = Instance.new("Part")
    weld.Part0 = hrp
    weld.Part1 = hitbox
    hitbox.Transparency = 1
    hitbox.CanCollide = false
    hitbox.CanQuery = false
    hitbox.Massless = true
    hitbox.Size = size
    hitbox.CFrame = hrp.CFrame + hrp.CFrame.LookVector * offset.X + Vector3.new(0,offset.Y)
    hitbox.Parent = character
    hitbox.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") == nil then return end
    for _, v in pairs(hitbox:GetChildren()) do
    if v:IsA("ObjectValue") then
    if v.Value == hit.Parent then return end
    end
    end
    local hitCounter = Instance.new("ObjectValue", hitbox)
    hitCounter.Value = hit.Parent
    hit.Parent.Humanoid:TakeDamage(damage)
    hit.Parent:FindFirstChild("Humanoid"):TakeDamage(100)
    end)
    game.Debris:AddItem(hitbox, linger)
    end
    hitboxEvent.OnServerEvent:Connect(function(plr, size, offset, damage, linger)
    newHitbox(plr.Character, size, offset, damage, linger)
    end)
    hope this might make it even more usefull
    also some animation id's of anims i made:
    left:rbxassetid://14791654126
    right:rbxassetid://14791354670

    • @sheepboy932
      @sheepboy932 Рік тому

      THE MOST W COMMENT
      W this man
      gte this man $1,000,000,000

    • @sheepboy932
      @sheepboy932 Рік тому

      also imsubbed

    • @sheepboy932
      @sheepboy932 Рік тому

      W mans

    • @Djredseaa
      @Djredseaa 11 місяців тому

      Also what is "hitBoxEvent" because that is the problem for me

    • @BebrenyatkoBebrik
      @BebrenyatkoBebrik 7 місяців тому

      @@Djredseaa Event from replicated storage

  • @NagibatorUnreal
    @NagibatorUnreal Рік тому +3

    Thank you, this is the best tutorial on creating a fighting game that I have seen. I copied everything myself :)

    • @MajesticUC
      @MajesticUC  Рік тому +2

      ty

    • @mason228x
      @mason228x Рік тому

      @@MajesticUC thank you! But how to do punching bag which can reset himself health after 3-5 sec after health == 0 what i need to do say pls i even did humanoid and homanoid root part in punching bag and did reset health after 3 sec but after 1 reset him health become 0 and i cant change it to 100

    • @Diddyseviltwin
      @Diddyseviltwin 10 місяців тому

      @@mason228x
      Respawn script
      local Copy = script.Parent:Clone()
      local NPC = script.Parent
      local Humanoid
      for i,v in pairs(NPC:GetChildren()) do
      if v:IsA('Humanoid') then
      Humanoid = v
      end
      end
      if Humanoid then
      Humanoid.Died:Connect(function()
      wait(5)
      Copy.Parent = NPC.Parent
      Copy:MakeJoints()
      NPC:Destroy()
      end)
      else
      warn('Cannot find Humanoid in Respawn Script!')
      end

  • @AlmightWTCH
    @AlmightWTCH Рік тому +3

    Omg i do really respect every developer, this remembers me how dumb i am 😢

  • @Monument_07
    @Monument_07 Рік тому +1

    thank you so much i always had problems when trying to make a fighting system i subscribed

  • @GiggleSaurasman
    @GiggleSaurasman 7 днів тому

    THANK YOU SOO MUCH I WENT THROUGH 10 TUTORIALS TRYNA DO THIS THANK U BRO

  • @boltlessOffical
    @boltlessOffical Рік тому +10

    It dosent work on used the replit ai 10 time to try to fix it but no I can’t punch at all

  • @user-cs1tp1ep9m
    @user-cs1tp1ep9m Рік тому +7

    thank you for making the music so loud to the point where you cant hear anything. very helpful in a tutorial video.

  • @SleepyMurda
    @SleepyMurda Рік тому +3

    I’m having guns,swords, knives, rocket launchers, maces, bows all that good stuff

    • @MajesticUC
      @MajesticUC  Рік тому +1

      I would recommend learning module scripts then

    • @nexi1mus
      @nexi1mus Місяць тому

      @MajesticUCwhat are those bro? cant gsearch rn

    • @NexusXC_YT
      @NexusXC_YT 6 днів тому

      @@nexi1mus like settings in a script if that makes sense

  • @MarkzCode
    @MarkzCode Рік тому +1

    Really good video dude, subbed.

  • @TheSlayerSenpai
    @TheSlayerSenpai 5 місяців тому

    Extremely Helpful video thanks so much. Helped me to learn a lot!

  • @Dracula-i7q
    @Dracula-i7q 6 місяців тому +6

    I spent 30 mins doing this and it dont work😭😭😭😭

    • @junkyasmr3343
      @junkyasmr3343 5 місяців тому

      Same lmao

    • @Trikks268
      @Trikks268 5 місяців тому

      Same🥲

    • @TrevSkatez
      @TrevSkatez 4 місяці тому

      real

    • @wolfyoutubeidk
      @wolfyoutubeidk 3 місяці тому

      SAME BRUH ):

    • @bradball3646
      @bradball3646 2 місяці тому

      @@wolfyoutubeidk same here but im pretty sure its because its an outdated script, the video was made a year ago

  • @abalaoverheaven1879
    @abalaoverheaven1879 Рік тому +4

    Got stuck on scripting the animation. I used r15 instead of r6, so did that mess it up perhaps; or did I just mess up somewhere in that void of code? I also used 8 different punch animations, so did that perhaps mess the whole thing up? idk anymore

    • @MajesticUC
      @MajesticUC  Рік тому +1

      as long as you used r15 animations and an r15 rig it should work fine. If you make 8 different animations you have to create 8 different variables and also store all of the anims (with their id's) inside the script.

    • @s1olereal
      @s1olereal Рік тому +1

      @@MajesticUC What am i supposed to put in offset,size and that parameters,im using r6 and im new to developing sorry if im making you mad.

    • @MajesticUC
      @MajesticUC  Рік тому +3

      Why would i be mad? The parameters are just for the hitbox it doesnt matter whether you are r6 or r15

    • @s1olereal
      @s1olereal Рік тому +1

      @@MajesticUC alright but what does offset,size and that stuff mean,like should i put 4,7,1 (width,height,depth amount of studs) in size? in offset what should i do?

    • @MajesticUC
      @MajesticUC  Рік тому +3

      Offset is a vector 3 and is the x distance and y distance the centre of the hitbox will be from the character. The size is a vector 3 and is the size of the hitbox, the damage is a number value and is just the amount of damage the hitbox deals and the linger is how long the hitbox exists for before it is destroyed. Also I put in the parameters for my hitboxes in the vid and in the pastebin

  • @IceAnimz
    @IceAnimz Рік тому +14

    "first save the game to rawblox"💀💀💀💀💀

  • @gmdflamey
    @gmdflamey Рік тому

    OMG TYSM I WAS LOOKING FOR HOURS TRYING TO FIND A WORKING TUTORIAL AND THIS ONE WORKS

  • @xertintanium
    @xertintanium Рік тому +9

    I was wondering how to make it so that when you press the combat button there will be different animations like:
    Punch, hook, kick, kick... repeat
    i think that would be cooler and i would be very thankful if you made a tutorial for that

    • @АлексейАбраменко-ж7щ
      @АлексейАбраменко-ж7щ Рік тому +2

      If you want something like that then that means you would need a different animation play for each tick punch that you are on so 1 would play punch 2 would play hook and so on

  • @semewl
    @semewl 6 місяців тому +6

    the m1's dont work?

  • @oscardcenteno5717
    @oscardcenteno5717 10 місяців тому +38

    For me it dont work

    • @zachPlushgaming
      @zachPlushgaming 9 місяців тому +13

      How this dude feels after saying the combat system doesn't work instead of checking the bug finder and using problem solving skills to figure out the conflict

    • @BluHat_
      @BluHat_ 9 місяців тому +5

      @@zachPlushgaminghe is right. The animations work perfectly, its the hitbox.
      My code has no errors, but the output doesnt do anything.

    • @zachPlushgaming
      @zachPlushgaming 9 місяців тому +1

      @BluHat_ adjust the hitbox then? He showed you how to

    • @BluHat_
      @BluHat_ 9 місяців тому +2

      @@zachPlushgaming yeah i did and its doesnt show up at all. The script is probably outdated.

    • @zachPlushgaming
      @zachPlushgaming 9 місяців тому

      @@BluHat_ did you make sure you didn't make it transparent???

  • @Greenaid69
    @Greenaid69 Рік тому +1

    finally an actually working combat system ( i was looking for a tool but it works too)

  • @alsssssssss
    @alsssssssss Рік тому

    OMG tysm! This is a very good tutorial that I can also understand! U deffo earned a subscribtion from me!1!!1

  • @space2079
    @space2079 Рік тому +39

    Jesus is the LORD

  • @propergato
    @propergato Рік тому +4

    hehehehaw

  • @NoodleIsSigma
    @NoodleIsSigma 11 місяців тому +1

    THANK YOU SO MUCH YOUR LIKE THE ONLY GUY THAT SHOWS US HOW

  • @bluepower-
    @bluepower- Рік тому

    Yo thx for the help bro I needed it 😊

  • @lartum1
    @lartum1 6 місяців тому +1

    Thank you for this. Im having some issues with animations but it doesnt have anything to do with the code so THXXXXX

  • @theCrazychimp
    @theCrazychimp Рік тому

    Thank god someone have a pastebin..
    This is so helpful man..
    Keep up your post ❤❤

  • @Paper_ScissorsYT
    @Paper_ScissorsYT 7 місяців тому

    W it took me 30min to do and the result is good tysm!!

  • @PaxProductions.
    @PaxProductions. Рік тому +1

    Loved the vid Ty so much bro

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

    How would I go about making a sound for the game? Do I have to make it myself, does Roblox have sounds that are avalible, or can I get it from other players? Please, and Thank you.

  • @Editz_OfficialOne
    @Editz_OfficialOne 6 місяців тому

    yo bro i got somthing to say
    You earned another sub💝💝

  • @edwardjustgaming
    @edwardjustgaming Рік тому +1

    i found out it said Hitbox instead of HitBox I finally figured it out Very helpful!

  • @mikaelmonteiro6189
    @mikaelmonteiro6189 Рік тому

    i love you bro this tutorial saved my life

    • @mikaelmonteiro6189
      @mikaelmonteiro6189 Рік тому

      okay update didnt work.
      seems like this part
      hitbox.Touched:Connect(function(hit)
      if hit.Parent:FindFirstChild("Humanoid") == nil then return end

      for _, v in pairs(hitbox:GetChildren()) do
      if v:IsA("ObjectValue") then
      if v.Value == hit.Parent then return end
      end
      end
      print("hitbox.touched v in pairs")

      local hitCounter = Instance.new("ObjectValue", hitbox)
      hitCounter.Value = hit.Parent

      hit.Parent.Humanoid:TakeDamage(damage)
      print("damage")
      end)

      game.Debris:AddItem(hitbox, linger)
      end
      isnt working

    • @mikaelmonteiro6189
      @mikaelmonteiro6189 Рік тому

      tested a bit more with print and its only that part that doesnt work

  • @sega4380
    @sega4380 5 місяців тому

    4:32 i was tweaking out for an hour because the animation would have gone Right punch, left punch, right punch and right punch you need to do
    ''If currentPunch == 2 then
    currentPunch = 1''

  • @JustRainYT
    @JustRainYT Рік тому

    After 5 hours of searching this is the one. It took me around 1-2 hours to learn. I thank you for this!

  • @kurama65299
    @kurama65299 Рік тому

    Im subscribed. You are also better than thedevking man

  • @klahoma
    @klahoma 4 місяці тому +1

    this is the local script if your too busy to write it, but its broken. can someone maybe fix it and reply with it fixed in the comments please?? ty
    local cas = game:GetService("ContextActionService")
    local plr = game.Players.LocalPlayer
    local character = plr.Character or plr.CharacterAdded:Wait()
    local hum = character:WaitForChild("Humanoid")
    local animator = hum:WaitForChild("Animator")
    local leftPunch = animator:LoadAnimation(script:WaitForChild("LeftPunch"))
    local rightPunch = animator:LoadAnimation(script:WaitForChild("RightPunch"))
    local currentpunch = 0
    local debounce = false
    local function punch()
    if debounce then return end
    debounce = true
    if currentPunch == 0 then
    rightPunch:Play()
    task.wait(0.4)
    debounce = false
    elseif currentPunch == 1 then
    leftPunch:Play()
    task.wait(0.4)
    debounce = false
    elseif currentPunch == 1 then
    leftPunch:Play()
    task.wait(0.4)
    debounce = false
    elseif currentPunch == 2 then
    rightPunch:Play()
    task.wait(0.8)
    debounce = false
    end
    if currentPunch == 2 then
    currentPunch = 0
    else
    currentPunch += 1
    end
    end
    cas:BindAction("Punch", punch, true Enum.UserInputType.MouseButton1)

    • @eoJotinhaTV
      @eoJotinhaTV 3 місяці тому

      In the last line there is a code error that I don't have enough skills to fix LOL,

    • @GermanBruv
      @GermanBruv 2 місяці тому

      the last line (fixed) is: cas:BindAction("Punch", punch, true, Enum.UserInputType.MouseButton1)

    • @klahoma
      @klahoma 2 місяці тому

      @@GermanBruv thanks bro

  • @trillius
    @trillius Рік тому +2

    could you please do a tutorial on punch-stun and the hit-animations the person whos getting hit has

  • @BUDPUD
    @BUDPUD 9 місяців тому +1

    Was complicated but worth it

  • @LukasUltraPogi
    @LukasUltraPogi 7 місяців тому

    Thanks for explaining the stuff i hate the copy and paste stuff its nice to learn

  • @bridittebargeot2679
    @bridittebargeot2679 2 місяці тому

    Only one that worked tysm man

  • @BlakeJAnimates
    @BlakeJAnimates 4 місяці тому +2

    this sadly didnt work for me when i get in to test if i could punch nothing happened :/

    • @ozeitex
      @ozeitex 14 днів тому

      becuase of the names check if your hit box write Hitbox with capital latter and rightpunsh with capital latter in P and R

  • @RobloxStudioTutorials.
    @RobloxStudioTutorials. Рік тому +1

    I want the damage to be as much as a stat. Its called Power, its in leaderstats inside of player. But idk how to acces the plr in that script

  • @Fishy_5
    @Fishy_5 4 місяці тому +1

    i was watching this video and then i realised i dont have the patience to do all this espesially when you dont explain a lot of the stuff like how to get the moon animator or what im supposed to type in the script but you seemed to help other ppl but i might just go back to making free model games

  • @mrjagaimo4265
    @mrjagaimo4265 5 місяців тому

    I hope you get everything in life thank you so much, the tick() m1 resset was super useful for what I needed.

  • @XiaoCin1123
    @XiaoCin1123 10 місяців тому

    Omg Thx! this helped me so much

  • @yaunas6538
    @yaunas6538 6 місяців тому +1

    at 2:57 how do i put the animations into the punchscript

  • @12YusufrghmKösesoy
    @12YusufrghmKösesoy 11 місяців тому

    IT HELPED A LOT TY DUDEEE

  • @isama_rou
    @isama_rou Рік тому

    FIRST GOOD VIDEO I SAW OF ROBLOX STUDIO bc other are... u know what i mean

  • @Number1VegitoGlazer
    @Number1VegitoGlazer Рік тому +1

    i know the video 9 months ago but still i copied the whole punch script but it didnt work, and i have ZERO idea why
    all i get is the "ServerScriptService.Hitbox' :41: Expected 'end' (to close 'function' at line 40), got

  • @elm565
    @elm565 Рік тому +1

    you're great at this

  • @the_blue_hole
    @the_blue_hole Рік тому

    I like how 100% of this video is the tutorial and everything he say it useful and important this really helped me

  • @povo1980
    @povo1980 Рік тому +2

    when i clicked on the animation it didnt show the anim id thing so i couldn't put in id anywhere.

  • @nguyenvantam3573
    @nguyenvantam3573 Рік тому +1

    how do i fix the PlayerGui.PunchScript:5: attempt to index nil with 'Character' - Server - PunchScript:5
    here are my 5th code line:
    local character = plr.Character or plr.CharacterAdded:Wait()

  • @Flopaw
    @Flopaw Рік тому +2

    thank you very much for helping me but i have a doubt about how to make a defense system do you have any idea how i can do it?

    • @MajesticUC
      @MajesticUC  Рік тому

      Wdym by defence system?

    • @Flopaw
      @Flopaw Рік тому

      @@MajesticUC An example I press "E" to defend the opponent's punch, I don't know how to do it so if you can help me I'd appreciate it bro

  • @miszcz101
    @miszcz101 Рік тому +1

    2:36 lets start scripting! Then throws a mayhem with the folders and i dont understand anything

  • @Hellnawbrainrot
    @Hellnawbrainrot 2 місяці тому

    I cant beleive it took that long to make punch animation the suffer of tsb dev is crazy

  • @BALLGOONWHYTEA
    @BALLGOONWHYTEA Місяць тому +1

    If you equip a tool/ item, does it stop the script? If not how can I make it do that

  • @Ze_o
    @Ze_o Місяць тому

    I have done what you said to do up to the 4:39 mark but my animation won’t work when I left click my my mouse😢. Does anyone have any recommendations that could help me get my animation to start playing 🙏

  • @Icypenguin931
    @Icypenguin931 4 місяці тому +1

    thanks for the tutorial it works but when i do a punch it randomly teleports me can u help me?

  • @Alurxxhaxxymxxl
    @Alurxxhaxxymxxl 5 місяців тому +1

    Is there a way you can change the hit button to something else for mobile players?

  • @daffagavinabyasa3922
    @daffagavinabyasa3922 Рік тому +1

    My punch animation doesn't work i already copy and paste the id but it doesn't work can anybody help ?

  • @comboguy12
    @comboguy12 Рік тому +2

    I have a question do I have to do the beginning first then copy and paste the paste bin

  • @rusteze6440
    @rusteze6440 Рік тому +2

    My animation won’t play😢

  • @14_-98
    @14_-98 Рік тому +2

    My Punch Script line 3 the output say player is not a valid member of "DataModel" What should i do please help.

    • @MajesticUC
      @MajesticUC  Рік тому

      What is datamodel in your explorer?

  • @Speaker_YouTube
    @Speaker_YouTube 8 місяців тому +1

    Every time I try adding the hitbox code it always doesn't load up the animation and the hitbox part, could you help me what i should do?

  • @goodtimeswithleo
    @goodtimeswithleo 5 місяців тому +1

    please i hope you will answer, so in my game i have a character selection system, and i want each character to have a different punch animation, hitbox size, etc.. please help me!

  • @GunstreakGOAT
    @GunstreakGOAT Рік тому +1

    I dont know why but my hitbox isn't showing at 7:15 please someone help me

    • @Luis.Guilherme
      @Luis.Guilherme Рік тому

      happened to me too

    • @trillius
      @trillius Рік тому

      ur hitbox's transparency is at 1, turn it to 0 to make it visible :)

    • @GunstreakGOAT
      @GunstreakGOAT Рік тому

      Do i need to the transparency to 0 in the script or how ?

  • @PsycSkiller
    @PsycSkiller Рік тому

    Good Work! Is Help my game

  • @DaBeastGang
    @DaBeastGang Рік тому +1

    How do I add punch animations into the local script?

    • @LO0IC
      @LO0IC Рік тому

      hold down shift.. and select the stuff.. drag it into the local script............... you dont even have to hold shift if you want..

    • @DaBeastGang
      @DaBeastGang Рік тому

      srry dident work@@LO0IC

  • @frogside8145
    @frogside8145 Рік тому +1

    for some reason, when I run the test, I can hit only 2 times in the script there are no errors.. and hit boxes don't want to work at all(

  • @adjanicki1
    @adjanicki1 Рік тому +1

    i only started working on studio a couple days ago, and today i encountered a problem with this.
    so, when i finished typing all of that up to 4:33 i tested it and when i saved it said it was uncommitted? it didnt work either? could someone tell me whats wrong?

    • @MajesticUC
      @MajesticUC  Рік тому

      If u cant understand any code or only know the absolute basics then u shouldnt be attempting to make a fighting game

  • @Benji_manc
    @Benji_manc 5 місяців тому +1

    Quick question!where is the submit for asset configuration cause I don’t see it on mine

  • @tudie_guitar
    @tudie_guitar Рік тому

    Very good tutorial!

  • @dinnamin2269
    @dinnamin2269 Рік тому +1

    My punch animation will only play the first time I click then dosnt work

  • @xason
    @xason Рік тому +1

    i copy'd everything and i dont know why but the damage is not working ;-;

  • @Gxst207
    @Gxst207 Рік тому +1

    I am a complete noob in developing so I have question how do I change punch from mouse button to "F"

    • @magcake_
      @magcake_ 10 місяців тому

      instead of user input type then do KeyCode == Enum.KeyCode.F

  • @OsBo566
    @OsBo566 3 місяці тому +1

    amazing video, how to i make it so you can only punch when a round starts in my game tho

  • @Zachrom
    @Zachrom Рік тому +2

    I have an issue where whenever I m1 the animation plays at kind of half proportions, the punch starts halfway up the body, it goes half as far, etc, does anyone know how to fix this?

    • @ultrol8223
      @ultrol8223 Рік тому

      same

    • @Zachrom
      @Zachrom Рік тому

      @@ultrol8223 I found out how to fix it, you need to change the priority to action then save it to Roblox again and use the new ID

    • @TheTheoryPiece
      @TheTheoryPiece Рік тому

      If the animation is to fast that’s why make it where your guy is in the defalt position at the end of one sec

  • @xxmortal_kombatxx0
    @xxmortal_kombatxx0 Рік тому +2

    can you make for both r15 game that looks like arsenal and cw

    • @MajesticUC
      @MajesticUC  Рік тому

      This will work on r15 as well.

    • @ADeityIsHere
      @ADeityIsHere Рік тому

      if you want to do it in R15 it's the same but with R15 animations and also all the avatars in R15

  • @Scizo_vr
    @Scizo_vr Рік тому +1

    Can you delete the animation in the animation editor if you have it saved for another animation you wanna make btw you earned a sub

  • @Sc0rned
    @Sc0rned Рік тому +1

    i can't seem to get anything to work, i have followed every bit of code that you wrote up too 4:33 and then from there nothing will play, no animations at all. i even tried to redo all the code and that didn't work. the pastebin one isn't working either. i have done everything you said to do but nothing is showing. Any help please would be nice :)

    • @MajesticUC
      @MajesticUC  Рік тому

      🤷‍♀️

    • @Hehelol3321
      @Hehelol3321 Рік тому

      @@MajesticUC do you know why I can’t see the hit box?

    • @MajesticUC
      @MajesticUC  Рік тому

      @@Hehelol3321 cos its invisible? or maybe it just isnt spawning in idk. Did you set transparency to 1?

    • @Hehelol3321
      @Hehelol3321 Рік тому

      @@MajesticUC omg it works I’m subscribing

  • @van-cw9qd
    @van-cw9qd 6 місяців тому

    your coding style is quite unique

  • @Slaygrim
    @Slaygrim 5 місяців тому +1

    Anyone know why when I hit the dummy it does nothing? Please and Thank you.

    • @Slaygrim
      @Slaygrim 5 місяців тому

      nvm I figured it out

    • @daiu3d596
      @daiu3d596 4 місяці тому

      How’d u do it ?

    • @Slaygrim
      @Slaygrim 3 місяці тому

      @@daiu3d596 I'm pretty sure it was due to my animation priority

  • @ace1i
    @ace1i Рік тому +1

    Pls help i cant add punch id to my left and right punch

  • @thegokupro118
    @thegokupro118 Рік тому

    even though im 4 months late, you helped me alot earned a sub!