part = game.Workspace.Part while true do local Newpos = pos wait(5) part.BrickColor = BrickColor.new("Maroon") pos = math.random(1,4) -- picks a number for pos if pos == 1 then --this makes decisions to where it teleports part.Position = game.Workspace.Start.Position part.BrickColor = BrickColor.new("Persimmon") elseif pos == 2 then part.Position = game.Workspace.Start2.Position part.BrickColor = BrickColor.new("Persimmon") elseif pos == 3 then part.Position = game.Workspace.Start3.Position part.BrickColor = BrickColor.new("Persimmon") elseif pos ==4 then part.Position = game.Workspace.Start4.Position part.BrickColor = BrickColor.new("Persimmon") end --end is underlined with red I cant figure out why and it is breaking my script
You forgot to put another end at the end xD Here's the fixed code ;)
part = game.Workspace.Part while true do local Newpos = pos wait(5) part.BrickColor = BrickColor.new("Maroon") pos = math.random(1,4) if pos == 1 then part.Position = game.Workspace.Start.Position part.BrickColor = BrickColor.new("Persimmon") elseif pos == 2 then part.Position = game.Workspace.Start2.Position part.BrickColor = BrickColor.new("Persimmon") elseif pos == 3 then part.Position = game.Workspace.Start3.Position part.BrickColor = BrickColor.new("Persimmon") elseif pos == 4 then part.Position = game.Workspace.Start4.Position part.BrickColor = BrickColor.new("Persimmon") end end