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

Can somebody help me fix my fireball script? Im having a error towards the bottom at the End)

Asked by 8 years ago
Edited by OldPalHappy 8 years ago

i made this script that shoots out fireballs but its not working, can someone tell me what i did wrong?

01local Tool = script.Parent
02play = Tool.Parent.Parent
03mouse = play:GetMouse()
04char = play.Character
05hum = char.Humanoid
06root = char.HumanoidRootPart
07 
08local en = true
09 
10Tool.RemoteEvent.OnServerEnevent:connect(function(play,mousehit)
11    local a = hum:LoadAnimation(Tool.Throw)
12    a:Play()
13    wait(0.7)
14    root.CFrame = CFrame.new(root.Position,root.Postition + Vector3.new(mousehit.lookVector.x,0,mousehit.lookVector.z))
15    local fireball = Tool.Handle:clone()
View all 51 lines...
0
I added your code in a code block. In the future, please do this yourself: https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site OldPalHappy 1477 — 8y
0
do you know the problem with it? bennacho570 0 — 8y
0
you cared enough to put it in boxes, but not to actually take a look and see the problem. bennacho570 0 — 8y

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
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".

01local Tool = script.Parent
02local play = Tool.Parent.Parent
03local mouse = play:GetMouse()
04local char = play.Character
05local hum = char.Humanoid
06local root = char.HumanoidRootPart
07local en = true
08 
09Tool.RemoteEvent.OnServerEvent:connect(function(play,mousehit)
10    local a = hum:LoadAnimation(Tool.Throw)
11    a:Play()
12    wait(0.7)
13    root.CFrame = CFrame.new(root.Position,root.Postition + Vector3.new(mousehit.lookVector.x,0,mousehit.lookVector.z))
14    local fireball = Tool.Handle:clone()
15    fireball.CFrame = Tool.Handle.CFrame
View all 51 lines...
0
Thank you so much! <3 bennacho570 0 — 8y
0
Remember to accept my answer if it helped you. It ensures both the asker and the answerer recieve the reputation they deserve. Goulstem 8144 — 8y
Ad

Answer this question