THIS TUTORIAL IS GREAT! one thing is, guys.. dont give up the first time u get an error, watch the video to the end and keep trying and testing things till it works
I just found out, if you don't have moon animator, and your using the normal animator, rename the key frames to "Hit" instead of creating a animation event. That's what i did and it worked
thank you! i am creating a game. ive made a punch animation and other things. i recommend using 120 fps for the punches so they are faster! overall i love this tutorial
I would look at a sprint script and see how that works then apply is so then if an animation is playing the playerSpeed would equal to ur new value, pudeocode would be this: defaultSpeed = 1000 // 1000 is just an example, this will also be ur actual speed baseSpeed = deafultSpeed slowSpeed = defaultSpeed * 0.2 // 0.2 is also just an example if animation is playing then defaultSpeed = slowSpeed else defaultSpeed = baseSpeed end
Bro your tutorials are so detailed and simple. Instead of me just copying what you do i review the things you did so i can apply them And learn from those things, You earned a sub from me
I like how u scripted it step by step as if you were a beginner, forgetting steps before making it work completely. This explains why it doesn't work and not just giving answers. Best scripting tut vid I've seen in years tbh good job.
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local userInputService = game:GetService("UserInputService") local dashDistance = 50 local dashCooldown = 1 local lastDash = 0 local function dash(direction) if tick() • lastDash >= dashCooldown then local rootPart = character:WaitForChild("HumanoidRootPart") local dashVector = rootPart.CFrame.LookVector * direction.Z + rootPart.CFrame.RightVector * direction.X rootPart.Velocity = dashVector * dashDistance lastDash = tick() end end userInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.W then dash(Vector3.new(0, 0, -1)) elseif input.KeyCode == Enum.KeyCode.S then dash(Vector3.new(0, 0, 1)) elseif input.KeyCode == Enum.KeyCode.A then dash(Vector3.new(-1, 0, 0)) elseif input.KeyCode == Enum.KeyCode.D then dash(Vector3.new(1, 0, 0)) end end)
you probably already fixed this but when I fixed it I felt pretty stupid. I put the Remotes folder inside of the Animations folder instead of ReplicatedStorage, and when I put the Remotes folder into ReplicatedStorage it worked.
So if you arent using moon animator what should you do instead of the animation event im guessing just rename the keyframe where the punch is at its farthest point
local rp = game:GetService("ReplicatedService") local remotes = rp:WaitForChild("Remotes") local animations = rp:WaitForChild("Animations") local punchRemotes = remtoes:WaitForChild("Punch") local MAX_COMBO = 4 local function changeCombo(char) local combo = char:GetAttribute("Combo") if combo >= MAX_COMBO then char:SetAttribute("Combo" ,1) else char:SetAttribute("Combo", combo + 1) end end local function getPunchAnim(char) local combo = char:GetAttribute("Combo") local punchAnims = animations:WaitForChild("Combat"):GetChildren() local currAnims = punchAnims[combo] return currAnims end punchRemote.OnServerEvent:(function(player) local char = player.Character local hum = char:WaitForChild("Humanoid") local humRp = char:WaitForChild("HumanoidRootPart") local attacking = char:GetAttribute("Attacking") local punching = char:GetAttribute("Punch") if attacking or punching then return end char:SetAttribute("Attacking" , true) char:SetAttribute("Punch , true) changeCombo(char) local playPunchAnim = hum:LoadAnimation(getPunchAnim(char)) playPunchAnim.KeyFrameReached:Connect(function(kf) if kf == "Hit" then char:SetAttribute("Attacking") , false) if char:GetAttrivute("Combo") == MAX_COMBO then task:wait(1) end char:SetAttribute("Punch" , false) end end) playPunchAnim:Play() end)
i did everything right and still doesnt work, the only thing that is different is the output chat thing. i dont have that, how do i get the output chat thing to like say something when it launches
@@saucerv2425 i feel stupid for not knowing that i found what the error was it says Infinite yield possible on 'Workspace.aaaeebaaee:WaitForChild("humanoid")'
still nobody knows how to fix it?@@opukich i also have this trouble Touched is not a valid member of Model "Workspace.Model.Model". i did absoulutely all right..
if you dont want the character to still walk at a normal speed while punching use this modified CombatClient: local rp = game:GetService("ReplicatedStorage") local remotes = rp:WaitForChild("Remotes") local animations = rp:WaitForChild("Animations") local punchRemote = remotes:WaitForChild("Punch") local ss = game:GetService("ServerStorage") local modules = ss:WaitForChild("Modules") local TomatoHitbox = require(modules:WaitForChild("TomatoHitbox")) local MAX_COMBO = 4 local function changeCombo(char) local combo = char:GetAttribute("Combo") if combo >= MAX_COMBO then char:SetAttribute("Combo",1) else char:SetAttribute("Combo",combo + 1) end end local function getPunchAnim(char) local combo = char:GetAttribute("Combo") local punchAnims = animations:WaitForChild("Combat"):GetChildren() local currAnim = punchAnims[combo] return currAnim end local function stopAnims(object) for i,v in pairs(object:GetPlayingAnimationTracks()) do v:Stop() end end punchRemote.OnServerEvent:Connect(function(player) local char = player.Character local hum = char:WaitForChild("Humanoid") local humRp = char:WaitForChild("HumanoidRootPart") local attacking = char:GetAttribute("Attacking") local punching = char:GetAttribute("Punch")
if attacking or punching then char.Humanoid.WalkSpeed = 4 wait(0.5) char.Humanoid.WalkSpeed = 16 end if attacking or punching then return end char:SetAttribute("Attacking",true) char:SetAttribute("Punch",true) changeCombo(char) stopAnims(hum) local newHitbox = TomatoHitbox.new() newHitbox.Size = Vector3.new(6,6,6) newHitbox.CFrame = humRp newHitbox.Offset = CFrame.new(0,0,-2.5) newHitbox.onTouch = function(enemyHum) if enemyHum ~= hum then enemyHum:TakeDamage(10) end end local playPunchAnim = hum:LoadAnimation(getPunchAnim(char)) playPunchAnim.KeyframeReached:Connect(function(kf) if kf == "Hit" then char:SetAttribute("Attacking",false) task.spawn(function() newHitbox:Start() task.wait(0.1) newHitbox:Stop() newHitbox:Destroy() end) if char:GetAttribute("Combo") == MAX_COMBO then task.wait(1) end char:SetAttribute("Punch",false) end end) playPunchAnim:Play() end)
For those of you who want the character to slow down while punching, here is my modified CombatServer script that does exactly that: local rp = game:GetService("ReplicatedStorage") local remotes = rp:WaitForChild("Remotes") local animations = rp:WaitForChild("Animations") local punchRemote = remotes:WaitForChild("Punch") local ss = game:GetService("ServerStorage") local modules = ss:WaitForChild("Modules") local TomatoHitbox = require(modules:WaitForChild("TomatoHitbox")) local MAX_COMBO = 4 local function changeCombo(char) local combo = char:GetAttribute("Combo") if combo >= MAX_COMBO then char:SetAttribute("Combo",1) else char:SetAttribute("Combo",combo + 1) end end local function getPunchAnim(char) local combo = char:GetAttribute("Combo") local punchAnims = animations:WaitForChild("Combat"):GetChildren() local currAnim = punchAnims[combo] return currAnim end local function stopAnims(object) for i,v in pairs(object:GetPlayingAnimationTracks()) do v:Stop() end end punchRemote.OnServerEvent:Connect(function(player) local char = player.Character local hum = char:WaitForChild("Humanoid") local humRp = char:WaitForChild("HumanoidRootPart") local attacking = char:GetAttribute("Attacking") local punching = char:GetAttribute("Punch") if attacking or punching then return end char:SetAttribute("Attacking",true) char:SetAttribute("Punch",true) changeCombo(char) stopAnims(hum)
hum.WalkSpeed = 8 -- THIS IS A LINE I ADDED local newHitbox = TomatoHitbox.new() newHitbox.Size = Vector3.new(4.5, 5, 4) newHitbox.CFrame = humRp newHitbox.Offset = CFrame.new(0,0,-1.5) newHitbox.onTouch = function(enemyHum) if enemyHum ~= hum then enemyHum:TakeDamage(10) end end local playPunchAnim = hum:LoadAnimation(getPunchAnim(char)) playPunchAnim.KeyframeReached:Connect(function(kf) if kf == "Hit" then char:SetAttribute("Attacking",false) task.spawn(function() hum.WalkSpeed = 15 -- THIS IS ANOTHER LINE I ADDED
newHitbox:Start() task.wait(0.1) newHitbox:Stop() newHitbox:Destroy() end) if char:GetAttribute("Combo") == MAX_COMBO then task.wait(1) end char:SetAttribute("Punch",false) end end) playPunchAnim:Play() end) Enjoy :)
Hey! I have followed this script almost entirely one to one, but for some reason whenever I start punching the error "ServerStorage.Modules.TomatoHitbox:159: attempt to call missing method '_Visualize' of table" floods my output repeatedly, and eventually causes massive lag to start building up. I also don't deal damage to the dummy at all. Any help would be greatly appreciated!
i hvanet watched the tutorial yet but i see that it says "TomatoHitbox" and the youtuber who made this tutorial´s name is... The Tomato, so im guessing if your roblox name isnt Tomato or something(but the youtubers rblx acc name would probably be) then i think in that part of the video youre supposed to write, like something else, maybe your username. But im not good in scripting language and i havent watched the tutorial yet so this is unlikely.
the script for the comabatserver code is not there so here local rp = game:GetService("ReplicatedStorage") local remotes = rp:WaitForChild("Remotes") local animations = rp:WaitForChild("Animations") local punchRemote = remotes:WaitForChild("Punch") local MAX_COMBO = 4 local function changeCombo(char) local combo = char:GetAttribute("Combo") if combo >= MAX_COMBO then char:SetAttribute("Combo",1) else char:SetAttribute("Combo",combo + 1) end end local function getPunchAnim(char) local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local rp = game:GetService("ReplicatedStorage") local remotes = rp:WaitForChild("Remotes") local animations = rp:WaitForChild("Animations")
local punchRemote = remotes:WaitForChild("Punch")
local ss = game:GetService("ServerStorage") local modules = ss:WaitForChild("Modules")
local TomatoHitbox = require(modules:WaitForChild("TomatoHitbox"))
local MAX_COMBO = 4
local function changeCombo(char) local combo = char:GetAttribute("Combo") if combo >= MAX_COMBO then char:SetAttribute("Combo",1) else char:SetAttribute("Combo",combo + 1) end end
local function getPunchAnim(char) local combo = char:GetAttribute("Combo") local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local currAnim = punchAnims[combo]
return currAnim end
local function stopAnims(object) for i,v in pairs(object:GetPlayingAnimationTracks()) do v:Stop() end end
punchRemote.OnServerEvent:Connect(function(player) local char = player.Character local hum = char:WaitForChild("Humanoid") local humRp = char:WaitForChild("HumanoidRootPart")
local attacking = char:GetAttribute("Attacking") local punching = char:GetAttribute("Punch")
Been working on using python to write games and before that course started i was confused on what was being said on the vid. Now I fully understand some of the aspects of the code. While not all of them (like the child commands) I can sort of interpret the code for roblox as python code. Both have very similar properties, just some writing differences.
at 0:30 you put something in ServerStorage but cut out whatever you put in, what was it? Cause I think it's something to do with Modules in the code that may be missing from when I started trying to mimic this tutorial step by step. It says that I'm missing Modules, didn't say it in my step by step re-creation. But when I made a second place to try and copy/paste the released scripts w/the same setup to see if that could fix my earlier issue, it gave me that error. And I realized there's nothing in my Server Storage on either place but there's something in yours
soo for me, it plays only 1 animation without hitbox and i did all the fixed that you provided in video, maybe there is a problem with events but i made an event called Hit, idk whats the reason
i edited the game in studio and the punching walking dashing and basically any animation doesnt work and i didnt mess with anything i just clicked edit in studio and tried the game and then well the animations didnt work. please fix this thank you and have a good day :)
Hey i got at problem with the red hitbox, where the the hitbox doesnt move along with the animation and its on my spawn stuck there? and its not dealing damage to the dummy??
Hello, so, for some reason when i punch I get an error on your hitbox: "TomatoHitbox:108: Unable to assign property CFrame.CoordinateFrame expected, got Vector3 any ways to solve it?
Hey, I've scanned through every single line and haven't been able to find a single reason as to why mine won't punch, I've all the settings as you and made sure of it, literally my first ever time using this studio (I'm used to basic 2d rendering in Javascript and such) any tips as to what may be happening? Cheers
I got only one error and is says " Infinite yield possible on 'ReplicatedStorage:WaitForChild("Punch")'" what does this mean and how can i fix it? And the animations dont play...
Props to this guy, I watched the entire vid and I dont even have Roblox studio. He made a tutorial that’s informative and entertaining
@@g0joshortsyou need to train text interpretation, and I don't even speak English.
@@Nalticobasically he’s saying when you get roblox studio, you have to log in through the studio and create a game.
@@IAmJuniorJuniorIsLifeYeah that’s the idea 🤔
corny levels dangerously high, termination reccomended
Bro just you in Mobile
THIS TUTORIAL IS GREAT! one thing is, guys.. dont give up the first time u get an error, watch the video to the end and keep trying and testing things till it works
the thing is i dont even get errors
@@aaaeebaaeeSame plus I speant two hours on this and it did NOTHING
for me it says "attempt to index nil with 'WaitForChild' "
like is the script it self the problem?
@@Thedudemandudemandude because you are dumb :/
@@jacksonsalles4078 no, you gotta be more specific dude, whats the full error
Damn man, I couldn't figure why the animations were not playing for my friend, and you just solved my problem casually. Thanks!
thats a kinda funny glitch that happens with roblox, Animation is private, if it continues, consider playing offline animations
I just found out, if you don't have moon animator, and your using the normal animator, rename the key frames to "Hit" instead of creating a animation event. That's what i did and it worked
what keyframes?
@@bruhwhosjustin the key frame right before the punch
in what folder?
sir i need help doing a combat system could you help me? if yes pls help me. also a saturo fan btw
How do u rename?
Finally I understand animations events, and they’re just what I need! Amazing tut man, earned a sub for sure!
yo how to create the animation event thing
left click and press insert object then select 'animation' or 'animator' or whatever you need@@stanleymiles2693
M2 click on the area where you put the key frame and click on "add event on here" or something like that
"whats your special talent?"
"typing in light speed."
What did you missed? Him editing the speed
💀
AHHAHAHA
just slow the video speed and ur good 🦕🦕
real
thank you! i am creating a game. ive made a punch animation and other things. i recommend using 120 fps for the punches so they are faster!
overall i love this tutorial
Make it that when you use m1s,you get slower like in all of battlegrounds games.
This video is also entertaining,not only informative.
I would look at a sprint script and see how that works then apply is so then if an animation is playing the playerSpeed would equal to ur new value, pudeocode would be this:
defaultSpeed = 1000 // 1000 is just an example, this will also be ur actual speed
baseSpeed = deafultSpeed
slowSpeed = defaultSpeed * 0.2 // 0.2 is also just an example
if animation is playing then
defaultSpeed = slowSpeed
else
defaultSpeed = baseSpeed
end
Bro your tutorials are so detailed and simple. Instead of me just copying what you do i review the things you did so i can apply them And learn from those things, You earned a sub from me
Same!
Thank you so much bro im working on a battleground game right now and this is helping me out A LOT
No problem 👍
SAME
SAME BOOBOOBEAR
is it dxd battlegrounds?
Bro where are the folders 😭
I was here before 100 views. I know, this video will be kinda popular. So im old tomato’s fan!
Me too
goated vid it helped me so much for my game
I like how u scripted it step by step as if you were a beginner, forgetting steps before making it work completely. This explains why it doesn't work and not just giving answers. Best scripting tut vid I've seen in years tbh good job.
ayo, very fire video man! Keep up the good work :]
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local userInputService = game:GetService("UserInputService")
local dashDistance = 50
local dashCooldown = 1
local lastDash = 0
local function dash(direction)
if tick() • lastDash >= dashCooldown then
local rootPart = character:WaitForChild("HumanoidRootPart")
local dashVector = rootPart.CFrame.LookVector * direction.Z + rootPart.CFrame.RightVector * direction.X
rootPart.Velocity = dashVector * dashDistance
lastDash = tick()
end
end
userInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.W then
dash(Vector3.new(0, 0, -1))
elseif input.KeyCode == Enum.KeyCode.S then
dash(Vector3.new(0, 0, 1))
elseif input.KeyCode == Enum.KeyCode.A then
dash(Vector3.new(-1, 0, 0))
elseif input.KeyCode == Enum.KeyCode.D then
dash(Vector3.new(1, 0, 0))
end
end)
I love you.
thanks bro.
Is it for the combat client or combat server
@@NubbThunder client
@@BartoszwirTT YOU LOVE ***?
GREAT VIDEO KEEP UP THE WORK!
why doesnt it work?
What’s the matter
@@T-Topsan so basically i used the script like he told me and other shit and when i tried it didnt work like wtf
@@Car_demon87you didn’t copy something right
You probably had it under a “normal script” instead of “local script”
Yes
Helped me out so much you deserve the support.
hey I need help I'm getting the error "Infinite yield possible on 'ReplicatedStorage:WaitForChild("Remotes")" what can I do to fix this?
you spelt the Remotes folder wrong
@@floppuhh no its spelled right i have the same issue but its with module
you probably already fixed this but when I fixed it I felt pretty stupid. I put the Remotes folder inside of the Animations folder instead of ReplicatedStorage, and when I put the Remotes folder into ReplicatedStorage it worked.
@@1LightZ7 then the folder is on wrong location
@@floppuhh very helpful -_-
can someone help me, i did the script and stuff but It Still Only Plays 1 animation
me too
@@bulitin2434 you guys play a animation?
So satisfying watching somebody code
beautiful. peak art. unbearably incredible.
1:58 what if I don’t have a numpad?
God knows brotha
u can use any 7 on ur keyboard u dont need to use numpad 7
Man bro your amazing,I can’t even animate but now I’ll try, thanks
So if you arent using moon animator what should you do instead of the animation event im guessing just rename the keyframe where the punch is at its farthest point
How to I rename
i think almost every animator has the event thing, unless you're doing it outside roblox studio
what do i do when this eror pops up Infinite yield possible on 'ServerStorage:WaitForChild("Modules")'
same problem 😭😭😭😭
😭😭😭😭😭😭😭😭@@Sansicmp
@@UTENSILS483 I found out why, u gotta go through the whole vid and add hitbox 😭
i dont think its need to be "Modules" i think its need to be "Models"
local rp = game:GetService("ReplicatedService")
local remotes = rp:WaitForChild("Remotes")
local animations = rp:WaitForChild("Animations")
local punchRemotes = remtoes:WaitForChild("Punch")
local MAX_COMBO = 4
local function changeCombo(char)
local combo = char:GetAttribute("Combo")
if combo >= MAX_COMBO then
char:SetAttribute("Combo" ,1)
else
char:SetAttribute("Combo", combo + 1)
end
end
local function getPunchAnim(char)
local combo = char:GetAttribute("Combo")
local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local currAnims = punchAnims[combo]
return currAnims
end
punchRemote.OnServerEvent:(function(player)
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humRp = char:WaitForChild("HumanoidRootPart")
local attacking = char:GetAttribute("Attacking")
local punching = char:GetAttribute("Punch")
if attacking or punching then return end
char:SetAttribute("Attacking" , true)
char:SetAttribute("Punch , true)
changeCombo(char)
local playPunchAnim = hum:LoadAnimation(getPunchAnim(char))
playPunchAnim.KeyFrameReached:Connect(function(kf)
if kf == "Hit" then
char:SetAttribute("Attacking") , false)
if char:GetAttrivute("Combo") == MAX_COMBO then
task:wait(1)
end
char:SetAttribute("Punch" , false)
end
end)
playPunchAnim:Play()
end)
love u
i did everything right and still doesnt work, the only thing that is different is the output chat thing. i dont have that, how do i get the output chat thing to like say something when it launches
press view and output
@@saucerv2425 i feel stupid for not knowing that
i found what the error was it says Infinite yield possible on 'Workspace.aaaeebaaee:WaitForChild("humanoid")'
@@aaaeebaaee replace 'humanoid' to 'Humanoid'
Hey, i got a question for you, how did you reflect the animation 1 and 2?
moon animator has it
@@TheRookieFan15 whats the keybind
@@TLWM111 control r
@@randoAnim I already know it now, But thanks mate
VERY GOOD ANIMATION I JUST LOVE IT🤩
can someone help?
i copy the code from the link but it still doesnt work.
i have r6 and the animation setting on standard
PLEASE HELP
Same
still nobody knows how to fix it?@@opukich
i also have this trouble Touched is not a valid member of Model "Workspace.Model.Model".
i did absoulutely all right..
what error are you getting
ok so idk how but i made it work!!!!!!!!
all i need now is just a slower cooldown
@@PAN1K572 HOOOOOOOOWWWW
Bro i just COPIED all the scripts but combat system dont working((
if you dont want the character to still walk at a normal speed while punching use this modified CombatClient:
local rp = game:GetService("ReplicatedStorage")
local remotes = rp:WaitForChild("Remotes")
local animations = rp:WaitForChild("Animations")
local punchRemote = remotes:WaitForChild("Punch")
local ss = game:GetService("ServerStorage")
local modules = ss:WaitForChild("Modules")
local TomatoHitbox = require(modules:WaitForChild("TomatoHitbox"))
local MAX_COMBO = 4
local function changeCombo(char)
local combo = char:GetAttribute("Combo")
if combo >= MAX_COMBO then
char:SetAttribute("Combo",1)
else
char:SetAttribute("Combo",combo + 1)
end
end
local function getPunchAnim(char)
local combo = char:GetAttribute("Combo")
local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local currAnim = punchAnims[combo]
return currAnim
end
local function stopAnims(object)
for i,v in pairs(object:GetPlayingAnimationTracks()) do
v:Stop()
end
end
punchRemote.OnServerEvent:Connect(function(player)
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humRp = char:WaitForChild("HumanoidRootPart")
local attacking = char:GetAttribute("Attacking")
local punching = char:GetAttribute("Punch")
if attacking or punching then
char.Humanoid.WalkSpeed = 4
wait(0.5)
char.Humanoid.WalkSpeed = 16
end
if attacking or punching then return end
char:SetAttribute("Attacking",true)
char:SetAttribute("Punch",true)
changeCombo(char)
stopAnims(hum)
local newHitbox = TomatoHitbox.new()
newHitbox.Size = Vector3.new(6,6,6)
newHitbox.CFrame = humRp
newHitbox.Offset = CFrame.new(0,0,-2.5)
newHitbox.onTouch = function(enemyHum)
if enemyHum ~= hum then
enemyHum:TakeDamage(10)
end
end
local playPunchAnim = hum:LoadAnimation(getPunchAnim(char))
playPunchAnim.KeyframeReached:Connect(function(kf)
if kf == "Hit" then
char:SetAttribute("Attacking",false)
task.spawn(function()
newHitbox:Start()
task.wait(0.1)
newHitbox:Stop()
newHitbox:Destroy()
end)
if char:GetAttribute("Combo") == MAX_COMBO then
task.wait(1)
end
char:SetAttribute("Punch",false)
end
end)
playPunchAnim:Play()
end)
Im pretty sure thats combat server?
why is it so delayed
can u write the first script ? thanks
very understandable and helpfull! Tysm
For those of you who want the character to slow down while punching, here is my modified CombatServer script that does exactly that:
local rp = game:GetService("ReplicatedStorage")
local remotes = rp:WaitForChild("Remotes")
local animations = rp:WaitForChild("Animations")
local punchRemote = remotes:WaitForChild("Punch")
local ss = game:GetService("ServerStorage")
local modules = ss:WaitForChild("Modules")
local TomatoHitbox = require(modules:WaitForChild("TomatoHitbox"))
local MAX_COMBO = 4
local function changeCombo(char)
local combo = char:GetAttribute("Combo")
if combo >= MAX_COMBO then
char:SetAttribute("Combo",1)
else
char:SetAttribute("Combo",combo + 1)
end
end
local function getPunchAnim(char)
local combo = char:GetAttribute("Combo")
local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local currAnim = punchAnims[combo]
return currAnim
end
local function stopAnims(object)
for i,v in pairs(object:GetPlayingAnimationTracks()) do
v:Stop()
end
end
punchRemote.OnServerEvent:Connect(function(player)
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humRp = char:WaitForChild("HumanoidRootPart")
local attacking = char:GetAttribute("Attacking")
local punching = char:GetAttribute("Punch")
if attacking or punching then return end
char:SetAttribute("Attacking",true)
char:SetAttribute("Punch",true)
changeCombo(char)
stopAnims(hum)
hum.WalkSpeed = 8 -- THIS IS A LINE I ADDED
local newHitbox = TomatoHitbox.new()
newHitbox.Size = Vector3.new(4.5, 5, 4)
newHitbox.CFrame = humRp
newHitbox.Offset = CFrame.new(0,0,-1.5)
newHitbox.onTouch = function(enemyHum)
if enemyHum ~= hum then
enemyHum:TakeDamage(10)
end
end
local playPunchAnim = hum:LoadAnimation(getPunchAnim(char))
playPunchAnim.KeyframeReached:Connect(function(kf)
if kf == "Hit" then
char:SetAttribute("Attacking",false)
task.spawn(function()
hum.WalkSpeed = 15 -- THIS IS ANOTHER LINE I ADDED
newHitbox:Start()
task.wait(0.1)
newHitbox:Stop()
newHitbox:Destroy()
end)
if char:GetAttribute("Combo") == MAX_COMBO then
task.wait(1)
end
char:SetAttribute("Punch",false)
end
end)
playPunchAnim:Play()
end)
Enjoy :)
thanks dude
@@choFu31 no problem!
my character is not able to punch, idk why tho
@@sqi_d
you need to create animation@@dejv9427
Infinite yield possible on 'ServerStorage:WaitForChild("Modules")' , how to fix this problem?
Props to this guy, I watched the entire vid and I dont even have Roblox studio
stolen
Hey! I have followed this script almost entirely one to one, but for some reason whenever I start punching the error "ServerStorage.Modules.TomatoHitbox:159: attempt to call missing method '_Visualize' of table" floods my output repeatedly, and eventually causes massive lag to start building up. I also don't deal damage to the dummy at all. Any help would be greatly appreciated!
Send your server script
same
i hvanet watched the tutorial yet but i see that it says "TomatoHitbox" and the youtuber who made this tutorial´s name is... The Tomato, so im guessing if your roblox name isnt Tomato or something(but the youtubers rblx acc name would probably be) then i think in that part of the video youre supposed to write, like something else, maybe your username. But im not good in scripting language and i havent watched the tutorial yet so this is unlikely.
@@JozinZeBazin Yeah that's not the problem. TomatoHitbox is just the name of the module, it has no connections to any username
@@pulograinhey I need help, when I put animations on the 20th scetence on combat server it says “unknown global user”
You saved alot of my time. Thanks for your hitbox system.
the script for the comabatserver code is not there so here
local rp = game:GetService("ReplicatedStorage")
local remotes = rp:WaitForChild("Remotes")
local animations = rp:WaitForChild("Animations")
local punchRemote = remotes:WaitForChild("Punch")
local MAX_COMBO = 4
local function changeCombo(char)
local combo = char:GetAttribute("Combo")
if combo >= MAX_COMBO then
char:SetAttribute("Combo",1)
else
char:SetAttribute("Combo",combo + 1)
end
end
local function getPunchAnim(char)
local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local currAnim = punchAnims[combo]
return currAnim
end
punchRemote.OnServerEvent:Connect(function(player)
local.char = player.Character
local.hum = char:WaitForChild("Humanoid")
local.humRp = char:WaitForChild("HumanoidRootPart")
local attacking = char:GetAttribute("Attacking")
local punching = char:GetAttribute("Punch")
if attacking or punching then return end
char:GetAttribute("Attacking",true)
char:GetAttribute("Punch",true)
changeCombo(cahr)
local playPunchAnim = hum:LoadAniamtion(getPunchAnim(char))
playPunchAnim:Play()
end)
you are the goat bro, TYSM
❤❤
in 27th line it sayin "Expected identifier when parsing variable name, got '.'" i cant fix this help
CombatClient
@@Fariza888 same here
doesnt work 😢
Question. What do I do if when I put in the Line of code that makes it so you can punch more It stops Punching?
tomato can you please make it a public model so we can use it right away it would be really helpful
thanks.
Lazy.
dawg you still need to spoof/make the animations yourself also its a tutorial to make your own battlegrounds not steal your own battlegrounds game
For the animation is it essential to remove the legs keyframe as my animation has the character kicking the opponent away
i cant punch
Try using your hands
@@crusader_gaming8273😂😂😂
@crusader_gaming8273 LOL
@@crusader_gaming8273 try using your brain
@@Rels_channelOHHHHHHHHH
what do you press to rotate and move a body part for your dummy in animation editor?
local rp = game:GetService("ReplicatedStorage")
local remotes = rp:WaitForChild("Remotes")
local animations = rp:WaitForChild("Animations")
local punchRemote = remotes:WaitForChild("Punch")
local ss = game:GetService("ServerStorage")
local modules = ss:WaitForChild("Modules")
local TomatoHitbox = require(modules:WaitForChild("TomatoHitbox"))
local MAX_COMBO = 4
local function changeCombo(char)
local combo = char:GetAttribute("Combo")
if combo >= MAX_COMBO then
char:SetAttribute("Combo",1)
else
char:SetAttribute("Combo",combo + 1)
end
end
local function getPunchAnim(char)
local combo = char:GetAttribute("Combo")
local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local currAnim = punchAnims[combo]
return currAnim
end
local function stopAnims(object)
for i,v in pairs(object:GetPlayingAnimationTracks()) do
v:Stop()
end
end
punchRemote.OnServerEvent:Connect(function(player)
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humRp = char:WaitForChild("HumanoidRootPart")
local attacking = char:GetAttribute("Attacking")
local punching = char:GetAttribute("Punch")
if attacking or punching then return end
char:SetAttribute("Attacking",true)
char:SetAttribute("Punch",true)
changeCombo(char)
stopAnims(hum)
local newHitbox = TomatoHitbox.new()
newHitbox.Size = Vector3.new(6,6,6)
newHitbox.CFrame = humRp
newHitbox.Offset = CFrame.new(0,0,-2.5)
newHitbox.onTouch = function(enemyHum)
if enemyHum ~= hum then
enemyHum:TakeDamage(10)
end
end
local playPunchAnim = hum:LoadAnimation(getPunchAnim(char))
playPunchAnim.KeyframeReached:Connect(function(kf)
if kf == "Hit" then
char:SetAttribute("Attacking",false)
task.spawn(function()
newHitbox:Start()
task.wait(0.1)
newHitbox:Stop()
newHitbox:Destroy()
end)
if char:GetAttribute("Combo") == MAX_COMBO then
task.wait(1)
end
char:SetAttribute("Punch",false)
end
end)
playPunchAnim:Play()
end)
TYSM
for some reason it doesnt work for me....
i used normal roblox animator
Rename the keyframes to Hit
Been working on using python to write games and before that course started i was confused on what was being said on the vid. Now I fully understand some of the aspects of the code. While not all of them (like the child commands) I can sort of interpret the code for roblox as python code. Both have very similar properties, just some writing differences.
how u move hand btw? i cant move it
while animating click R
at 9:10 i try to punch and it gave me a error call LoadAnimation requires the asset id to not be empty what do i do? (nvm i fix it)
how did you fix it i need help with that
i use reguler animation editor soooo how to use animations events?
can you PLEASE make it so the pastebin scripts have the finished result. because the main doesnt have the saem script as in the video.
yeah but, what if you dont have a group (3:59)
How did you make the 2nd punch mirror like that?
Hello! I don't like hitboxes but i like your work, so can you make without hitboxes?
You can do ontouch with the enemyhum
Can I use the first animation and like make it twice? (Explaining: 1 click Punch1 2 click Punch2 3 click Punch1 4 click Punch3
)
if you are using the roblox editor, how do you 'export' the animation?
Publish to Roblox
I got a slight problem any help I'd appreciate but for some reason I can't punch I set it to R6 I put in the scripts and stuff can anyone help out?
im getting an error called "Infinite yield possible on 'ServerStorage:WaitForChild("Modules")'
create a folder named Modules and put the module into it
what module
@@bebra3392
The issue is how would ultimate's be made? For the cutscenes i mean, i don't have moon animator but I am not sure if I need it for that.
im going to work on this little by little everyday it looks really good! I'll keep updated.
Why did you play animation on server and not client?
Ty man now my and my friend can develop our battlegrounds game
i did everything you did but for some reason it just doesn't punch, can u tell me why?
BRO TYYYY VERY MUCH YOU JUST SAVING MY PROJECT'S LIFE
at 0:30 you put something in ServerStorage but cut out whatever you put in, what was it? Cause I think it's something to do with Modules in the code that may be missing from when I started trying to mimic this tutorial step by step. It says that I'm missing Modules, didn't say it in my step by step re-creation. But when I made a second place to try and copy/paste the released scripts w/the same setup to see if that could fix my earlier issue, it gave me that error. And I realized there's nothing in my Server Storage on either place but there's something in yours
Aight. I've spent more than 6 hours on just this single 10 minute video. This one ain't for me chief,
@@fireblade-cp8uw have you put the TomatoHitbox in the ServerStorage?
and u need to make a folder named "Modules" then put the TomatoHitbox in
It Was Just Moon Animator Files😭
what is the animation priority?🤔🤔🤔
Could I use blender instead of moon animator?
i kinda made one animation that has everything that it more better then this does that change anything?
Can you do a part 3 for abilities and adding new characters?
How do you get that thing in start that board you need.where up you get it?
soo for me, it plays only 1 animation without hitbox and i did all the fixed that you provided in video, maybe there is a problem with events but i made an event called Hit, idk whats the reason
question, can you make a tutorial for adding: swords, aura's,... to the animations?
Hi, this doesn't work.
My character only deals 1 hit and that's it.
Gow u export pls tell me
im having a problem with the animation not playing it just gives me an error that says ''LoadAnimation requires an Animation object''
i edited the game in studio and the punching walking dashing and basically any animation doesnt work and i didnt mess with anything i just clicked edit in studio and tried the game and then well the animations didnt work. please fix this thank you and have a good day :)
Yo Great vid but can you use the roblox animation for me? I dont know how to use the moon/blender animator
bro, how do i create a animation event in the normal animation editor ?
U can animate it with the video right for animation
How did you get the graphs on the moon animator
you click the keyframe twice
Hi i have a problem, i followed all the tutorial but it does only one hit and deals no damage. Can you help me?
I've the same
YESSSS TYSM NOW I CAN DO COMBAT SYSTEM IN MY GAME!!!!!!!
i did this tutuorial and for some reason my punches only come once. Then when im done my 4th punch, i mcant punch anymore
It is too basic scripting, the system is basic and efficient, it is good for players who want to become true developers, a very useful video!
wat is animatio event using for?
Guys! I need help, when I put animations on the 20th scetence on combat server it says “unknown global user”
You got yourself a new subscriber
why can i only hit once and the hitbox doesnt even show up
for some reason i could only play one animation even though i but the script in right? (Please Help)
HOW TO DID EVENT ON BASIC ROBLOX ANIMATION
Can you make a simple one for beginners because this one is way too hard for me as I just starting scripting roblox studio this year
do you add animation event to every animation or just the first one?
every
Hey i got at problem with the red hitbox, where the the hitbox doesnt move along with the animation and its on my spawn stuck there?
and its not dealing damage to the dummy??
Hello, so, for some reason when i punch I get an error on your hitbox: "TomatoHitbox:108: Unable to assign property CFrame.CoordinateFrame expected, got Vector3
any ways to solve it?
im using roblox studio so what do i do when i have to put the stuff in the folders?
can any body help this is the error im gettng 21:03:12.415 Infinite yield possible on 'ServerStorage:WaitForChild("Modules")'
Hey, I've scanned through every single line and haven't been able to find a single reason as to why mine won't punch, I've all the settings as you and made sure of it, literally my first ever time using this studio (I'm used to basic 2d rendering in Javascript and such) any tips as to what may be happening? Cheers
It might be something outside of the code make sure everything is organized like the video
I got only one error and is says " Infinite yield possible on 'ReplicatedStorage:WaitForChild("Punch")'" what does this mean and how can i fix it? And the animations dont play...
whenever i m1 it plays the animation but at a completely diffrent speed of how i want it to and its alot slower how do i fix that
what dose the animation event do?