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

Hello, can someone explain why this won't work?

Asked by 8 years ago

It's supposed to be making it so if i click with the tool (like you do with a normal tool) it fires a projectile (kinda new to scripting so the chance of this being to high level for me is very high) Thank you for answering (if you answer ofcourse)

Chara = script.Parent.Parent
mouse = Chara:GetMouse()
tool = script.Parent

tool.Activated:connect(onActivate)

        local Light = Instance.new('Part')
        Light.Shape = Enum.PartType.Ball
        Light.Size = Vector3.new('10, 10, 10')
        Light.Material = ('Neon')
        Light.BrickColor = BrickColor.new('New Yeller')
    Light.TopSurface = "Smooth"
    Light.BottomSurface = "Smooth"
    local y = Instance.new('BodyVelocity')
    y.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
    y.velocity = Chara.Character.Torso.CFrame.LookVector*80
    Light.Parent = game.Workspace
    y.Parent = Light
    local Deco = Instance.new('ParticleEmmiter', Light)
    Deco.Color = ColorSequence.new(255, 255, 0)
    Deco.Lifetime = NumberRange.new(3)
    Deco.Speed = 5
    Deco.Rate = 50
    Light.CFrame = Chara.Character.Toro.CfFrame*CFrame.new(0, 0, -10)
    script.Disabled = true  
    wait(6)
    Light:Destroy()
    wait(4)
    script.Disabled = false

end

Answer this question