local tool = script.Parent
local anims = game.ReplicatedStorage:WaitForChild("Anims")
local mp = anims:FindFirstChild("Mini Pekka")
local Slash = mp:FindFirstChild("Slash")
local HitboxModule = require(game.ReplicatedStorage:WaitForChild("Hitbox"))
local newHitbox = HitboxModule.New()
local cd = false
tool.Equipped:Connect(function()
if cd == false then
tool:Activate()
end
end)
tool.Activated:Connect(function()
if cd then return end
cd = true
char = tool.Parent
hrp = char:FindFirstChild("HumanoidRootPart")
hum = char:FindFirstChild("Humanoid")
local hitboxCFrame = hrp.CFrame * CFrame.new(0,0,-5)
local hitboxSize = Vector3.new(5,5,5)
local createHitbox = workspace:GetPartBoundsInBox(hitboxCFrame, hitboxSize)
local attack = hrp:FindFirstChild("Attack")
local pancakes = hrp:FindFirstChild("Pancakes")
local hit = hrp:FindFirstChild("Hit")
local slashtrack = hum.Animator:LoadAnimation(Slash)
hum:UnequipTools()
slashtrack:Play()
attack:Play()
task.wait(.75)
attack:Stop()
slashtrack:GetMarkerReachedSignal("Hit"):Connect(function()
task.spawn(function()
HitboxModule:StartD(char, .3)
end)
local victim = {}
for _, v in pairs(createHitbox) do
if v.Parent:FindFirstChild("Humanoid") and not victim[v.Parent.Name] and v.Parent ~= char then
vhum = v.Parent:FindFirstChild("Humanoid")
victim[v.Parent.Name] = true
vhum:TakeDamage(10)
hit:Play()
end
end
end)
for i = 12, 0, -1 do
print(i)
wait(1)
end
cd = false
end)
#GetMarkerReachedSignal happens only once
1 messages · Page 1 of 1 (latest)
the hitbox works the first time but when i try to use it again its like the keyframe event disappears
the hitbox doesnt appear again
send video maybe?
** You are now Level 5! **
you have an error on 61 btw, make sure to say ‘’local’’