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
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