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'
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)
Line 19 - Its spelled with 2 t's, not 2 m's
local Deco = Instance.new('ParticleEmmiter', Light)
local Deco = Instance.new('ParticleEmitter', Light)
On line 24 did you mean to type in Toro? Light.CFrame = Chara.Character.Toro.CfFrame*CFrame.new(0, 0, -10)