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

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

[Output log]

20:38:28.189 - Players.Player.Backpack.Tool.Script:31: '<eof>' expected near 'end'

0
Sorry for the accidental double post, my mouse is kinda glitched. DannyPotter 10 — 8y
0
Please open the Output window! The output window is useful for checking what went wrong. Please follow this link to learn how to open the output window: http://wiki.roblox.com/index.php?title=Output . Copy any errors (red text) that you see after running this script. XAXA 1569 — 8y
1
20:33:01.591 - Players.Player.Backpack.Tool.Script:31: '<eof>' expected near 'end' DannyPotter 10 — 8y
1
is what the output log said DannyPotter 10 — 8y

3 answers

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

On line 24, it's Torso. You also didn't properly connect a function, as you don't have a function:

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

tool.Activated:connect(function()

    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('ParticleEmmitter', Light)
    Deco.Color = ColorSequence.new(255, 255, 0)
    Deco.Lifetime = NumberRange.new(3)
    Deco.Speed = 5
    Deco.Rate = 50
    Light.CFrame = Chara.Character.Torso.CFrame*CFrame.new(0, 0, -10)
    script.Disabled = true  
    wait(6)
    Light:Destroy()
    wait(4)
    script.Disabled = false
end)
0
that most likely explains it thank you DannyPotter 10 — 8y
0
Glad I could help. Shawnyg 4330 — 8y
Ad
Log in to vote
1
Answered by
iNicklas 215 Moderation Voter
8 years ago

Line 19 - Its spelled with 2 t's, not 2 m's

local Deco = Instance.new('ParticleEmmiter', Light)
local Deco = Instance.new('ParticleEmitter', Light)
0
ah, thank you the spelling mistake DannyPotter 10 — 8y
Log in to vote
-1
Answered by 8 years ago

On line 24 did you mean to type in Toro? Light.CFrame = Chara.Character.Toro.CfFrame*CFrame.new(0, 0, -10)

0
that might be the problem i'll see if it fixes it DannyPotter 10 — 8y
0
It didn't fix it unfortunatly DannyPotter 10 — 8y

Answer this question