As the title says, there Is a move (a tool without a handle) under an NPC, upon activation, the NPC will slash there sword, on contact It will deal damage towards enemies (while making the player and the vicitim rise up) then a final blow, dealing massive about of damage, the problem Is that It keeps forcing the player to go up, and If the vicitim does not die, they stay Idle, but not moving up, help!
Script:
local Tool = script.Parent local CanDamage = false local Debounce = false Tool.Activated:Connect(function() if not Debounce then Debounce = true CanDamage = true Tool.SwordSlash:Play() local Anim = Tool.Parent.Humanoid:FindFirstChild("Animator"):LoadAnimation(Tool.Animation) Anim:Play() wait(2) Debounce = false CanDamage = false end end) Tool.Parent.Sword.Touched:Connect(function(hit) local Humanoid = hit.Parent:WaitForChild("Humanoid") if Humanoid.Name == "Stonk Troll" and Humanoid then Humanoid.Parent.HumanoidRootPart.Anchored = true Tool.Parent.HumanoidRootPart.Anchored = true for i=0, 3 do Tool.SwordSlash:Play() Humanoid:TakeDamage(30) Humanoid.Parent.HumanoidRootPart.Position = Humanoid.Parent.HumanoidRootPart.Position + Vector3.new(0,10,0) Tool.Parent.HumanoidRootPart.Position = Tool.Parent.HumanoidRootPart.Position + Vector3.new(0,10,0) wait(1) end wait(0.1) Humanoid:TakeDamage(10000) Humanoid.Parent.HumanoidRootPart.Anchored = false Tool.Parent.HumanoidRootPart.Anchored = false CanDamage = false else if Humanoid and CanDamage == true and Humanoid.Parent.IsMetal.Value == false then Humanoid.Parent.HumanoidRootPart.Anchored = true Tool.Parent.HumanoidRootPart.Anchored = true for i=0, 3 do Tool.SwordSlash:Play() Humanoid:TakeDamage(53) Humanoid.Parent.HumanoidRootPart.Position = Humanoid.Parent.HumanoidRootPart.Position + Vector3.new(0,10,0) Tool.Parent.HumanoidRootPart.Position = Tool.Parent.HumanoidRootPart.Position + Vector3.new(0,10,0) wait(1) end wait(0.1) Humanoid:TakeDamage(100) Humanoid.Parent.HumanoidRootPart.Anchored = false Tool.Parent.HumanoidRootPart.Anchored = false CanDamage = false elseif Humanoid and CanDamage == true and Humanoid.Parent.IsMetal.Value == true then Humanoid.Parent.HumanoidRootPart.Anchored = true Tool.Parent.HumanoidRootPart.Anchored = true for i=0, 3 do Tool.SwordSlash:Play() Humanoid:TakeDamage(2) Humanoid.Parent.HumanoidRootPart.Position = Humanoid.Parent.HumanoidRootPart.Position + Vector3.new(0,10,0) Tool.Parent.HumanoidRootPart.Position = Tool.Parent.HumanoidRootPart.Position + Vector3.new(0,10,0) wait(1) end wait(0.1) Humanoid.Parent.HumanoidRootPart.Anchored = false Tool.Parent.HumanoidRootPart.Anchored = false Humanoid:TakeDamage(10) CanDamage = false end end end) Tool.Equipped:Connect(function() Tool.Unsheath:Play() Tool.Unequipped:Connect(function() Tool.Unsheath:Play() end) end)
Your positioning could be wrong try getting rid of 10, and changing the 3rd or 1st 0 to 10 to see if that would work. Make sure your tool isn't anchored or weld to anything!!
May seem off-topic, as I didn't quite understand what you mean, but If its going down instead of up, try making the number negative.
If you try making it like 6 but it goes down or smth, just mae it -6
SORRY IF THIS IS OFF-TOPIC... :C