Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I made an Admin script but the part where I put all scripts where they need to be isn't working?

Asked by 5 years ago
Edited 5 years ago

Ok so I made an admin but this isn't working, I want script fixed directly please.

Script:

local RS = game.ReplicatedStorage
local SSS = game.ServerScriptService
local SS = game.ServerStorage
local SG = game.StarterGui

local ReplicatedStorage = script.ReplicatedStorage:GetChildren()
local ServerScriptService = script.ServerScriptService:GetChildren()
local ServerStorage = script.ServerStorage:GetChildren()
local StarterGui = script.StarterGui:GetChildren()

ReplicatedStorage.Parent = RS
ServerScriptService.Parent = SSS
ServerStorage.Parent = SS
StarterGui.Parent = SG

(The error its the they aren't changing the parents)

1 answer

Log in to vote
0
Answered by
DogeIXX 172
5 years ago

You can't give a table a parent. But you can give every single item a parent.

local RS = game.ReplicatedStorage
local SSS = game.ServerScriptService
local SS = game.ServerStorage
local SG = game.StarterGui

local ReplicatedStorage = script.ReplicatedStorage:GetChildren()
local ServerScriptService = script.ServerScriptService:GetChildren()
local ServerStorage = script.ServerStorage:GetChildren()
local StarterGui = script.StarterGui:GetChildren()
for i, Part in ipairs(ReplicatedStorage) do
Part.Parent = RS
end
for i, Part in ipairs(ServerScriptService) do
Part.Parent = SSS
end
for i, Part in ipairs(ServerStorage) do
Part.Parent = SS
end
for i, Part in ipairs(StarterGui) do
Part.Parent = SG
end

If it timeouts, maybe add some wait() in the script.

0
It worked perfectly! Thank you for the fast answer! fenix2020 7 — 5y
Ad

Answer this question