#HitBox Issue
1 messages · Page 1 of 1 (latest)
Here is the local script
only for testing
thats why it doesnt have with remote event
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local punch = script.Parent
local hitbox = game.ReplicatedStorage:WaitForChild("Hitbox")
local anim = punch.Animation
local debounce = false
local runConnection
local track1, track2
local track = animator:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
punch.Activated:Connect(function()
if debounce == true then return end
debounce = true
track:Play()
print("played")
track1 = track:GetMarkerReachedSignal("Punch1"):Connect(function()
local clone = hitbox:Clone()
clone.Parent = workspace
clone.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0,0,-3)
runConnection = RunService.Heartbeat:Connect(function()
for i,v in pairs(workspace:GetPartsInPart(hitbox)) do
local hum = v.Parent:FindFirstChild("Humanoid")
if hum then
clone:Destroy()
hum:TakeDamage(10)
runConnection:Disconnect()
break
end
end
track2 = track:GetMarkerReachedSignal("Punch2"):Connect(function()
task.wait(1)
runConnection:Disconnect()
track1:Disconnect()
track2:Disconnect()
clone:Destroy()
end)
end)
end)
task.wait(1)
debounce = false
end)```
** You are now Level 6! **
even tho it says 10 damage
and sometimes I die even tho I didnt spam click it
is it because of the run service?
if yes then how do i fix it?
load animation 🫀
thats already deprecated
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local punch = script.Parent
local hitboxTemplate = game.ReplicatedStorage:WaitForChild("Hitbox")
local anim = punch:WaitForChild("Animation")
local debounce = false
punch.Activated:Connect(function()
if debounce then return end
debounce = true
local track = animator:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track:Play()
local hitConnection, punch1Conn, punch2Conn
punch1Conn = track:GetMarkerReachedSignal("Punch1"):Connect(function()
local clone = hitboxTemplate:Clone()
clone.Parent = workspace
clone.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 0, -3)
hitConnection = RunService.Heartbeat:Connect(function()
for _, part in pairs(workspace:GetPartsInPart(clone)) do
local hum = part.Parent:FindFirstChildOfClass("Humanoid")
if hum and hum ~= humanoid then
hum:TakeDamage(10)
clone:Destroy()
hitConnection:Disconnect()
break
end
end
end)
end)
punch2Conn = track:GetMarkerReachedSignal("Punch2"):Connect(function()
task.wait(0.5)
if hitConnection then hitConnection:Disconnect() end
if punch1Conn then punch1Conn:Disconnect() end
if punch2Conn then punch2Conn:Disconnect() end
end)
task.wait(1)
debounce = false
end)
here
oh
thx
@frigid heath yo so how did you fix it
?
like it works now
if I spam it doesnt like one shot me in less than a sec
was this the only issue
?
I thought smth else
I think cause it's already deprecated
What does the console says
Things that have been removed
it said nothing
oh
thats why it overlapped
and thats also why I got more dmg
am I right?
k