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
--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
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)
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
--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)
Absolutely no idea why this is in my recommended but this is pretty useful. Thank you!
keep going
will do
please continue this series because im going on with you, also how many more parts are you gonna do?
probably 6 episodes
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
Can u make tutorial about how to make a katana flash dash skill (tool) like thunder clap from demon slayer
why not
@@Sen23456 yessirrrrrr
how do you give yourself the sword w the animations ect?
for animations create your own animation and the sword is free model
@@Sen23456 do you got discord?
yeah
User: SenTheCoder#0824