im trying to make a script where after pressing a key, the item gets thrown, but the item aint getting thrown... instead the item is just teleporting to the sky and starts falling uncontrollably
script.Parent.Grip = CFrame.new(script.Parent.Grip.Position)*CFrame.fromEulerAngles(math.rad(0),math.rad(180),math.rad(90))
local anim = script.Parent.Parent.Humanoid.Animator:LoadAnimation(script.Parent.SwordAnim)
anim.Priority = Enum.AnimationPriority.Action
anim:Play()
local swordd = script.Parent.Handle:Clone()
local pos = script.Parent.Handle.CFrame.Position --i tried to use this to get the sword to its old position but it wont work
local lv = script.Parent.Parent.HumanoidRootPart.CFrame.LookVector
anim:GetMarkerReachedSignal("THR"):Connect(function() -- this works properly
swordd.Rest.Union.Touched:Once(function(part)
if part.Parent:FindFirstChild("Humanoid") then
local kbsc = require(game:GetService("ServerScriptService").KB)
kbsc.kob(script.Parent.Parent, part.Parent, 158, 12, 35)
end
end)
swordd.Parent = workspace
swordd.Position = pos -- this is the part, i removed :ApplyImpulse line for debugging but it doesnt work
-- even if i remove that line it wont work :sob:
script.Parent.Grip = CFrame.new(script.Parent.Grip.Position) * CFrame.fromEulerAngles(math.rad(-90),math.rad(0),math.rad(90))
end)```