Answered by
8 years ago Edited 8 years ago
TAB YOUR CODE CORRECTLY!!
The error was quite obious once the code was tabbed correctly. You neglected to close your if statement on line 29.
Also, you made a typo on line 10. "OnServerEnevent" should be "OnServerEvent".
01 | local Tool = script.Parent |
02 | local play = Tool.Parent.Parent |
03 | local mouse = play:GetMouse() |
04 | local char = play.Character |
05 | local hum = char.Humanoid |
06 | local root = char.HumanoidRootPart |
09 | Tool.RemoteEvent.OnServerEvent:connect( function (play,mousehit) |
10 | local a = hum:LoadAnimation(Tool.Throw) |
13 | root.CFrame = CFrame.new(root.Position,root.Postition + Vector 3. new(mousehit.lookVector.x, 0 ,mousehit.lookVector.z)) |
14 | local fireball = Tool.Handle:clone() |
15 | fireball.CFrame = Tool.Handle.CFrame |
16 | local bv = Instance.new( "BodyVelocity" ) |
17 | bv.MaxForce = Vector 3. new( 1 e 8 , 1 e 8 , 1 e 8 ) |
18 | bv.Velocity = mousehit.lookVector * 50 |
20 | fireball.CanCollide = false |
21 | fireball.Parent = game.Workspace |
22 | game.Debris:AddItem(fireball, 4 ) |
24 | fireball.Touched:connect( function (hit) |
25 | if not ten then return end |
27 | local ehum = hit.Parent:findFirstChild( "Humanoid" ) or hit.Parent.Parent:findFirstChild( "Humanoid" ) |
29 | if ehum and ehum ~ = hum then |
31 | elseif hit.Anchored and hit.CanCollide then |
33 | local part = fireball:Clone() |
34 | part.Size = Vector 3. new( 0.5 , 0.5 , 0.5 ) |
35 | part.CFrame = fireball.CFrame |
36 | part.BodyVelocity.MaxForce = Vector 3. new( 1 e 8 , 0 , 1 e 8 ) |
37 | part.ParticleEmitter.LockedToPart = false |
38 | part.BodyVelocity.Veloctiy = Vector 3. new( |
43 | part.Parent = workspace |
44 | game.Debris:AddItem(part, 1 ) |