Hello guys, is there a better way to reference an object in my situation.
My current situation is that I have a Train. The Train gets destroyed and regenerated. So, for an extremely little amount of time, the train is gone from the game.
However, this means I have to keep referencing train every time I want to use it, so as to ensure I am referencing the current Train and not the destroyed one.
Does anyone have a better method than me just referencing?
Example
Wrote this script here so the format might be incorrect
while true do
wait()
local Train = game.workspace:waitforchild("Train")
--Train Stuff and Code
end