local RE = game.ReplicatedStorage.HitEvent
local canDamage = true
function onTouch(otherPart)
local hum = otherPart.Parent:FindFirstChild("Humanoid")
if hum then
if canDamage == true then
canDamage = false
hum.Health = hum.Health - 15
task.wait(0.4)
canDamage = true
end
end
end
RE.OnServerEvent:Connect(function(player, hitbox)
local hum = player.Character:FindFirstChild("Humanoid")
hitbox.Parent = workspace
local motor = Instance.new("Motor6D")
motor.Part0 = hitbox
motor.Part1 = player.Character:FindFirstChild("Torso")
hitbox.CFrame = player.Character:FindFirstChild("Torso").CFrame + Vector3.new(0, 0, -4)
task.wait(0.2)
hitbox.Parent = game.ReplicatedStorage
end)
hitbox.Touched:Connect(onTouch)```
I want it so the hitbox moves with the torso, meaning if i look back it'll do the hitbox normally infront of me, NOT BACKWARDS.
#hitbox not moving
1 messages · Page 1 of 1 (latest)
@vernal bay can you help
or
?
btw i tried normal weld, weld constraint and motor6d and it still doesnt work
what's wrong with what you have now?
it works perfectly normal
but when i look backwards and do hitbox
the hitbox is behind me now
no
itself
howdoidothat
one moment
ok
hitbox.CFrame = player.Character:FindFirstChild("Torso").CFrame * CFrame.new(Vector3.new(0, 0, -4))
instead of this
thanks!!!!!