Feedback on my Changing Models/Scripts Parent Script!

Hello everyone!

I made some cool code (took a long time)

Please give feedback on this too !


local Part = game.ReplicatedStorage.PartFolder.Part

Part.Parent = workspace

print("Working Teleportation")

wait(100000000)
2 Likes

I can’t tell if this is satirical or not. Regardless, great job! Also the:

wait(100000000)

is unnecessary if that is the end of the script.

Yeah, I did that so it wouldn’t keep repeating.

But I think It won’t repeat and it’s safe to remove that. Should I remove the

wait(100000000)?

Is it within a loop? Or inside a Gui that resets on death? Otherwise, it shouldn’t repeat.

2 Likes

Congratulations on your finished script :+1:

I found this interesting and decided to see how else I could improve it as feedback, here is my revised version of the script. :slightly_smiling_face:

function returnServices()
    local R = game:GetService("ReplicatedStorage")
    local W = game:GetService("Workspace")
    return R, W
end

local Replicated, Work = returnServices()

local TargetObject = Replicated.PartFolder.Part

TargetObject.Parent = Work

print("Reparented " .. TargetObject.Name .. " to" .. Work.Name)

wait(.1) -- To prevent crashing if code presented is inside of a looped program.

Getting the services via the getService() method is a great way to avoid errors and termination of the script in case Service names are changed by any chance, some developers like to randomize service names to cause a small amount of exploit scripts to error.

2 Likes