You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I’m attempting to make a test boss fight for my game as a template for future bosses.
- What is the issue? Include screenshots / videos if possible!
Even when I roll, his attacks still hit! I am sure I’m not touching the hitbox at all.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve added 2 separate checks for if the player got hit. But besides that, I really don’t know what to do to fix this. I’ve never dealt with hitboxes much.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Hitbox code:
for _, v in pairs(partsinhitbox) do
if v.Name == "BlockDetect" then
if v.Blocking.Value == true then
blocked = true
me.HumanoidRootPart.Block:Play()
v.Blocked.Value = true
game.ReplicatedStorage.StaminaChange:FireClient(targetplr,45)
attackanim:Stop()
print("blocked")
else
print("touchedblocker")
end
if v.Parry.Value == true then
print("parried")
blocked = true
me.Parried.Value = true
v.Parried.Value = true
me.HumanoidRootPart.Parry:Play()
attackanim:Stop()
hum.WalkSpeed = 0
end
else
if v.Parent == target then
if canhit == true then
if blocked == false then
if target.Humanoid:GetAttribute("iframe") == false then
canhit = false
target.Humanoid:TakeDamage(script.Damage.Value)
target.Humanoid.WalkSpeed = 8
game.ReplicatedStorage.StaminaChange:FireClient(targetplr,10)
target.Humanoid.Died:Connect(function()
target = nil
targetplr = nil
end)
task.wait(1)
target.Humanoid.WalkSpeed = 16
end
end
end
end
end
end
clone.Touched:Connect(function(hit)
if hit.Parent == target then
if canhit == true then
if blocked == false then
if target.Humanoid:GetAttribute("iframe") == false then
canhit = false
target.Humanoid:TakeDamage(script.Damage.Value)
target.Humanoid.Died:Connect(function()
target = nil
targetplr = nil
end)
target.Humanoid.WalkSpeed = 8
game.ReplicatedStorage.StaminaChange:FireClient(targetplr,10)
task.wait(1)
target.Humanoid.WalkSpeed = 16
end
end
end
end
end)
Recording:
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.