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

How do I get this fireball script to work?

Asked by 9 years ago

I am trying to get shark to breathe fire and my script has the same error each time. It says: Workspace.Shark.ToothlessMainScript:10: '=' expected near 'breathefire' What does this mean ?

Here is my script

therewasnonameleft --CHECK WHOLE SCRIPT

local sp = script.Parent

local head =sp:WaitForChild("Head") local fireballscript = sp:WaitForChild("FireballScript") -- function that spawns part in dragons head funtion breathefire() local fireball = instance.new("Part") fireball.Transparency = 1 fireball.Name = "Effect" -- naming it fireball.BrickColor = BrickColor.new("Bright Orange") --makes it orange fireball.size=Vector3.new(2,2,2)-- big/small, size fireball.CanCollide = false -- doesnt bounce of thingies fireball.cFrame = head.Cframe fireball.Velocity=head.CFrame.lookVector*math.random(30, 70) --speed fireball.TopSurface = "Smooth" fireball.BottomSurface = "Smooth" local fire= Instance.new("Fire") fire.Parent =fireball fireball.Parent=game.Workspace -- makes it exist

local firescript=fireballscript:clone() firescript.Parent=fireball firescript.Disabled = false

 fireball.Parent=game.Workspace -- makes it exist

end

while true do wait(2) breathefire() breathefire() breathefire() breathefire() end

1
Code block all your scripts please. EzraNehemiah_TF2 3552 — 9y
0
Agree with this person ^ ConnorVIII 448 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

A lot of things happend. You spelled, "function" wrong.


Also, the brick color for "Bright Orange" is spelled with a lower case "o" in "Orange".


local sp = script.Parent

local head =sp:WaitForChild("Head")
local fireballscript = sp:WaitForChild("FireballScript")
function breathefire()
local fireball = instance.new("Part", workspace)--Instance.new has 2 arguments. The object and it's parent. "Therefore fireball.Parent = game.Workspace" isn't needed.
fireball.Transparency = 1
fireball.Name = "Effect" -- naming it fireball.
BrickColor = BrickColor.new("Bright orange") --Lua is case sensitive. Say "Bright orange" instead of "Bright Orange".
fireball.size=Vector3.new(2,2,2)
fireball.CanCollide = false
fireball.cFrame = head.Cframe
fireball.Velocity=head.CFrame.lookVector*math.random(30, 70)
fireball.TopSurface = "Smooth"
fireball.BottomSurface = "Smooth"
local fire= Instance.new("Fire")
fire.Parent =fireball

local firescript=fireballscript:clone()
firescript.Parent=fireball firescript.Disabled = false
end

while wait(2) do --"while wait(2)" do is the same as "while wait do wait(2)"
breathefire() breathefire() breathefire() breathefire()
end
0
Thanks, this was very helpful! therewasnonameleft 0 — 9y
Ad

Answer this question