This problem has been solved but feel free to still look at this. This chat has ended so no more comments will be replied by me
FYI
This is my first Topic post so if something looks wrong please let me know thanks
Hello! I am trying to make an infinite road that moves and never stops that makes somewhat of a cut scene. If you ever played Bus Simulator you will know what I mean
I’m trying to make it so that way if the code fails the output will be messaged. This is what I have so far (This is in my test server)
Note that behind Model4 is the workspace
From top to bottom of my scripts I have this
Script 1
wait(3)
while true do --you will see why it repeats in a few lines later
local gwm4 = game.Workspace.Model4 --easier if i just do that
gwm4.InfiniteRoad.Script.Disabled = false --make disabled script enabled
if gwm4.InfiniteRoad.Script.Disabled = false then -- double checking I think here is the problem
print("Infinite Road script loaded successfully")
script:Destroy() --the script worked and is not needed anymore so it will be deleted
elseif
print("error retrying") --this is where the while true do comes in
end
end
This one was from the toolbox but i changed it to go somewhat of how I want it this is not the final version of this next script because I need to do testing
Script 2 (disabled)
time = 0.5 --Time between movements
brick = script.Parent --So you don't have to rename anything
-----------------------------------------
moveX = 0
moveY = 0 -- Moves X up by one.
moveZ = 4
-----------------------------------------
while true do -- Makes a loop
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ)
wait (time)
end -- Ends loop
Again got this script below from the toolbox but changed it to how I want it
Script 3
while true do
wait(3)
C = script.Parent:Clone()
C.Position = script.Parent.Position
C.CanCollide = true
C.Anchored = true
C.Script:Remove()
C.Parent = game.Workspace.Model4.InfiniteRoad
C.Name = "Road"
end
The first script is so that way the second script doesnt get confused saying “There are no bricks!” The second script is the moving script and the third script is the cloning script. I will add in a deleting script so there wont be as much lag but I will ask that question later as an edit here. Also fyi I am also not a very good scripter
EDIT: maybe I didnt explain what I wanted correctly: I know there is something wrong with script 1 but im not sure what
EDIT 2: Hello I am back from my school and my hw is completed. I will now try to do what you all said.