Ok so I have a code where after players have loaded up into the map it changes their parent. In the same code I also have where it changes the items in their "inventory custom folder" to the actual ROBLOX inventory. Well you see moving the items into the custom inventory folder works and so does moving the players parent to a folder but moving them again does not why? It even prints out "Parent Changed" but when I go and check in sever mode it didnt change.
This is my code:
It has a ton of whitespace and useless code I know, but it WORKS. The important part is Line 67 and 82 - 88.
while true do
wait (0.5)
value = game.ServerStorage.Map.Players
timer = game.ServerStorage.Map.Time
if game.ServerStorage.Map.Players.Value == 1 then
for i = 20,0,-1 do
if value.Value >= 1 then
wait (1)
timer.Value = i
elseif value == 0 then
timer.Value = 20
end
end
if game.ServerStorage.Map.Time.Value == 0 then
print "LoadedMap"
local themap = game.ServerStorage.Map.Build:Clone()
themap.Parent = game.Workspace
tpposy = math.random(0,100000)
tpposx = math.random(0,100000)
tpposz = math.random(0,100000)
themap.Part.Position = Vector3.new (tpposy,tpposx,tpposz)
print (tpposx)
wait (1)
local players = game.Workspace.PlayersMap:GetChildren()
for i = 1, #players do
playerthing = players[i]
rootpart = players[i].HumanoidRootPart
playerparent = players[i].Parent
wait (0.5)
rootpart.CFrame = CFrame.new(tpposy,tpposx,tpposz)
rootpart.CFrame = CFrame.new(tpposy,tpposx,tpposz)
rootpart.CFrame = CFrame.new(tpposy,tpposx,tpposz)
rootpart.CFrame = CFrame.new(tpposy,tpposx,tpposz)
wait (1)
playerparent = game.Workspace
print "Parent Changed"
game.ServerStorage.Map.Players.Value = 0
game.ServerStorage.Map.Closed.Value = true
actualplayer = game.Players:GetPlayerFromCharacter(playerthing)
playerweapons = actualplayer.Inventory:GetChildren()
playerweapons.Parent = actualplayer.Backpack
end
end
end
end
