Hey! So right now, I’m making a combat system. I’m stumped on how to check if the hitbox part exists without a while true do loop. Is there anything that could help me with this? Here’s the script for reference. I’ve already tried searching for similar problems. Is there something I may have missed when searching?
game.ReplicatedStorage.HitboxEvents.CreateHitbox.OnServerEvent:Connect(function(plr, hitbox)
if hitbox == 2 then
local hitboxpart = game.ReplicatedStorage.WeaponHitboxes.Shonai.Slice2:Clone()
hitboxpart.Parent = game.Workspace
hitboxpart.CFrame = plr.Character.Torso.CFrame
hitboxpart.Position = hitbox.Position + Vector3.new(-1,0,-5)
hitboxpart.Name = "hitbox"
elseif hitbox == 3 then
local hitboxpart = game.ReplicatedStorage.WeaponHitboxes.Shonai.Slice3:Clone()
hitboxpart.Parent = game.Workspace
hitboxpart.CFrame = plr.Character.Torso.CFrame
hitboxpart.Name = "hitbox"
end
end)