Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Saber throw can't figure out what the problem is? [closed]

Asked by 6 years ago
Edited by RubenKan 6 years ago

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 ?

01function ThrowAttack()
02    if throwing == true and enabled then
03        candamage = true
04        local saber = character:findFirstChild(ls)
05        local throwingHandle = saber:Clone()
06        DebrisService:AddItem(throwingHandle, 5)
07        throwingHandle.Parent = game.Workspace
08        for _, child in ipairs(throwingHandle:GetChildren("ManualWeld" and "EmitterWeld" and "SaberWeld")) do
09        child:remove()
10        end
11        wait()
12        throwingHandle.Handle.Velocity = (mouse.TargetPoint - saber.Handle.CFrame.p).unit * 100
13        saber.Handle.SaberWeld.C0 = CFrame.new(saber.Handle.CFrame.p, saber.Handle.CFrame.p + saber.Handle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
14        local floatingForce = Instance.new('BodyForce', saber.Handle)
15        floatingForce.force = Vector3.new(0, 196.2 * saber.Handle:GetMass() * 0.98, 0)
View all 39 lines...
1
Oh my. Put it in code block properly please. Zafirua 1348 — 6y
0
Do you get any errors? Sergiomontani10 236 — 6y

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?