So I have a problem im a star wars developer and my players have been asking me to add saber throw to the lightsabers here's a part of it .. Did I forgot something ?
function ThrowAttack() if throwing == true and enabled then candamage = true local saber = character:findFirstChild(ls) local throwingHandle = saber:Clone() DebrisService:AddItem(throwingHandle, 5) throwingHandle.Parent = game.Workspace for _, child in ipairs(throwingHandle:GetChildren("ManualWeld" and "EmitterWeld" and "SaberWeld")) do child:remove() end wait() throwingHandle.Handle.Velocity = (mouse.TargetPoint - saber.Handle.CFrame.p).unit * 100 saber.Handle.SaberWeld.C0 = CFrame.new(saber.Handle.CFrame.p, saber.Handle.CFrame.p + saber.Handle.Velocity) * CFrame.Angles(0, 0, math.rad(-90)) local floatingForce = Instance.new('BodyForce', saber.Handle) floatingForce.force = Vector3.new(0, 196.2 * saber.Handle:GetMass() * 0.98, 0) local spin = Instance.new('BodyAngularVelocity', saber.Handle) spin.angularvelocity = saber.Handle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0)) wait() if saber.Handle then local touchedConn = saber.Handle.Touched:connect(function(hit) saber.Handle.Velocity = (mouse.TargetPoint + saber.Handle.CFrame.p).unit * 100 saber.Handle.SaberWeld.C0 = CFrame.new(saber.Handle.CFrame.p, saber.Handle.CFrame.p + saber.Handle.Velocity) * CFrame.Angles(0, 0, math.rad(-90)) local floatingForce = Instance.new('BodyForce', saber.Handle) floatingForce.force = Vector3.new(0, 196.2 * saber.Handle:GetMass() * 0.98, 0) local spin = Instance.new('BodyAngularVelocity', saber.Handle) spin.angularvelocity = saber.Handle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0)) end) end wait(0.6) if saber.Handle and throwing then WeldParts(character["Right Arm"]) saber.Handle.SaberWeld.C0 = CFrame.new(0,-1,0) * CFrame.fromEulerAnglesXYZ(math.rad(90),math.rad(180),math.rad(180)) saber.Parent = character throwing = false candamage = false end end end
Closed as Non-Descriptive by User#19524, GreekGodOfMLG, and Avigant
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?