Well each ride is grouped, then inside that is smaller groups of different parts. I just alt + click on the regen button to directly access it, so i could just go around each ride selecting the button and pasting the new script in?
Just put the script in ServerScriptService for organisation sakes, it would also work in workspace, and run the code straight away, outnside of the event.
No, if you re-parent them to a folder that wouldn’t affect anything. Although that might mess up scripts that references one of the rides and is not inside of that ride. If not, you should be good.
Pretty much, if they’re all inside of a single folder, you can loop through the folder’s children, and regen them.
Ok, thank you. I think so I don’t mess anything else up, i’m just going to search for ‘Regen’ in the explorer, disabled all those scripts then paste in the new one @FastAsFlash_Dev wrote, so i can keep optimised performance. Thank you all for your help!
Would you know how i can make a script inside the rides that would regen them on world startup, but only then and no other time? I only want it for a couple and not all…
Finding out which rides are broken would be a hard thing to implement. Maybe try actually regening all the rides, and see if it lags. I doubt it honestly, it’s just cloning, parenting and making joints. Also you’re gonna do it only once, and at the start of the server where there is only 1 playe, so it’s fine I think.
local folder = game.Workspace.Folder --assuming this is the folder
for i, v in pairs(folder:GetChildren()) do
v:Destroy() --v is the current ride
local back = save:Clone()
back.Parent = location
back:MakeJoints()
end
So even though the rides are grouped inside of the folder, it would still regen them? And would this script go inside of serverscriptservice? My guess is its a normal script and not local too? And finally, i assume the name of the ride groups won’t matter either?
Yeah, it’s regening everything inside the folder.
Yes, it’s a server script, as I said earlier ServerScriptService is a nice place for server scripts.
Yeah it doesn’t matter, v is refering to the current ride.
The error is pretty obvious. You should be in the call out for things like these. You don’t have save and location defined. I omitted them in the script I sent. Add those variables back.
From my original script? I’m not very good with scripting, sorry! Would this be the location
(local location = script.Parent.Parent.Parent), because surely then it would look for the parent of the parent of the parent of the script in serverscriptservice, and not the ride? Sorry again!