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 followed a tutorial on how to make a throwing knife on roblox.
-
What is the issue? Include screenshots / videos if possible! The knife goes down and curves and falls after about 30 studs.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub? I tried a lot of this (2 many to list tbh) and none of worked. I’ll restart my entire script if I have to.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local knife = script.Parent
local handle = knife:WaitForChild("Handle")
local throwRE = knife:WaitForChild("ThrowKnife")
local throwAnim = script:WaitForChild("ThrowAnimation")
local cooldown = 2
local isCooldown = false
throwRE.OnServerEvent:Connect(function(plr, mouseHit, key)
if key ~= "ㅤ" then
plr:Kick()
return
end
local character = plr.Character
if not character or not character:FindFirstChild("Humanoid") then return end
if isCooldown then return end
isCooldown = true
character.Humanoid:LoadAnimation(throwAnim):Play()
wait(0.4)
local knifeClone = handle:Clone()
knifeClone.Velocity = mouseHit.LookVector * 300
knifeClone.Parent = workspace
handle.Transparency = 1
knifeClone.Throw:Play()
knifeClone.CFrame = CFrame.new(knifeClone.Position, mouseHit.LookVector * 300)
local bav = Instance.new("BodyAngularVelocity")
bav.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
bav.AngularVelocity = knifeClone.CFrame:VectorToWorldSpace(Vector3.new(-400, 0, 0))
bav.Parent = knifeClone
game.ReplicatedStorage.ClientKnife:FireAllClients(knifeClone, knife.Parent)
knifeClone.Touched:Connect(function(touched)
if touched.Transparency < 1 and not knife.Parent:IsAncestorOf(touched) then
local humanoid = touched.Parent:FindFirstChild("Humanoid") or touched.Parent.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
knifeClone.Anchored = true
knifeClone.Hit:Play()
wait(knifeClone.Hit.TimeLength)
knifeClone:Destroy()
end
end)
wait(cooldown - 1)
isCooldown = false
handle.Transparency = 0
end)