Okay, so I’ve been having more issues while I’m modifying the game but the knife floats when I throw it at a player/npc. I’m using welds and LinearVelocity so I don’t know if it’s accurate.
important part of the script
KnifeAnimation:GetMarkerReachedSignal("SpawnKnifeDagger"):Connect(function()
Character.Humanoid.WalkSpeed = 6
KnifeDagger = ReplicatedStorage.Assets.KnifeDagger:Clone()
KnifeDagger.Anchored = true
KnifeDagger.Parent = workspace
local KnifeDaggerDebounce = false
local UnseatheSound = script.KnifeUnsheathe:Clone()
UnseatheSound.Parent = KnifeDagger
UnseatheSound:Play()
KnifeDagger.Touched:Connect(function(Hit)
local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
if Humanoid then
if Hit.Parent.Name ~= Player.Name and Hit.Parent.Parent.Name ~= Player.Name then
if not KnifeDaggerDebounce then
KnifeDaggerDebounce = true
AttackHitboxes.CreateHitbox(Character, KnifeDagger.Size, 25, true, Humanoid.Parent.HumanoidRootPart.CFrame)
local Weld = Instance.new("WeldConstraint")
Weld.Part0 = KnifeDagger
Weld.Part1 = Hit
Weld.Parent = KnifeDagger
local BloodSound = script.BloodSound:Clone()
BloodSound.Parent = Hit
BloodSound:Play()
local BloodParticle = script.Blood:Clone()
BloodParticle.Parent = Humanoid.Parent.HumanoidRootPart
BloodParticle:Emit(50)
task.delay(5, function()
KnifeDagger:Destroy()
end)
end
end
end
end)
for i=1,27 do
KnifeDagger.CFrame = Character["Right Arm"].RightGripAttachment.WorldCFrame
task.wait()
end
Character.Humanoid.WalkSpeed = 16
task.delay(3, function()
if KnifeDagger or KnifeDagger.Parent ~= nil then
KnifeDagger:Destroy()
end
end)
end)
KnifeAnimation:GetMarkerReachedSignal("ThrowKnifeDagger"):Connect(function()
local KnifeThrowSound = script.KnifeThrow:Clone()
KnifeThrowSound.Parent = KnifeDagger
KnifeThrowSound:Play()
KnifeDagger.VectorForce.Force = Vector3.new(0, KnifeDagger.Mass * workspace.Gravity, 0)
KnifeDagger.Anchored = false
KnifeDagger:SetNetworkOwner(Player)
KnifeDagger.AssemblyLinearVelocity = (Character.HumanoidRootPart.CFrame.LookVector * 100)
end)