#Hitbox not working correctly

1 messages · Page 1 of 1 (latest)

unreal cloud
#

LocalScript: local sound = handle["Sword Slash Sfx"]
local uis = game:GetService("UserInputService")
local event = game.ReplicatedStorage.swordEvent
local m1 = humanoid.Animator:LoadAnimation(game.ReplicatedStorage.SwordAnims.m1)
m1.Priority = Enum.AnimationPriority.Action

local m2 = humanoid.Animator:LoadAnimation(game.ReplicatedStorage.SwordAnims.m2)
m2.Priority = Enum.AnimationPriority.Action

local m3 = humanoid.Animator:LoadAnimation(game.ReplicatedStorage.SwordAnims.m3)
m3.Priority = Enum.AnimationPriority.Action

local combo = 1

tool.Activated:Connect(function()
if combo == 3 then
event:FireServer()
m3:Play()
sound:Play()
wait(1)
combo = 1
elseif combo == 2 then
event:FireServer()
m2:Play()
sound:Play()
combo = combo + 1
elseif combo == 1 then
event:FireServer()
m1:Play()
sound:Play()
combo = combo + 1
end
end)

#

ServerScript: local event = game.ReplicatedStorage.swordEvent

event.OnServerEvent:Connect(function(plr)
local hitbox = Instance.new("Part")
hitbox.Parent = workspace
hitbox.CanCollide = false
hitbox.Anchored = false
hitbox.Size = Vector3.new(6,6,11)
hitbox.Transparency = 0.5
hitbox.Massless = true
hitbox.Color = Color3.new(1, 0, 0)
local weld = Instance.new("WeldConstraint")
weld.Parent = hitbox
weld.Part0 = hitbox
weld.Part1 = plr.Character:WaitForChild("HumanoidRootPart")
hitbox.CFrame = plr.Character:WaitForChild("HumanoidRootPart").CFrame

hitbox.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -5) --
game.Debris:AddItem(hitbox, 1)
end)

#

^ this aint working

#

Fixed, changed weldconstraint to weld

#

but now

polar island
#

should maybe work with welds too i didn't see that part