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 am trying to make the tool not detect the player that is touching it -
What is the issue? Include screenshots / videos if possible!
-- wait(0.1)
local plr = script.Parent.Parent.Parent
local char = plr.Character
local idle = char.Humanoid:LoadAnimation(script.Animations.Idle)
local equipped = false
local attacking = false
local RaycastHitbox = require(game.ServerScriptService.RaycastHitboxV4)
local Hitbox = RaycastHitbox.new(script.Parent.Weapon)
local attack1 = char.Humanoid:LoadAnimation(script.Animations.Attack1)
Hitbox.OnHit:Connect(function(hit, humanoid)
attack1:AdjustSpeed(2)
local damage = math.random(50,65)
if humanoid then
if hit.Parent ~= char then
humanoid:TakeDamage(damage)
script.Parent.Weapon.Hit:Play()
humanoid.Parent.keffect.effect.Value = "headboom"
end
end
end)
script.Parent.Equipped:Connect(function()
idle:Play()
equipped = true
end)
script.Parent.Unequipped:Connect(function()
idle:Stop()
equipped = false
end)
script.Parent.Activated:Connect(function()
if not attacking and equipped then
attack1:Play()
attacking = true
wait(1.2)
Hitbox:HitStart()
script.Parent.Weapon.Swing:Play()
wait(0.24)
Hitbox:HitStop()
wait(0.24)
attacking = false
end
end)