Hi, i have been looking for hours how to do it but couldn't find anything. Does anyone know how to unanchor a model from a script AFTER a specific time? Lets say if map (Model) named (Map1) spawns in, then after 5 seconds the whole map will unanchor.
Map changing script
while true do game.Lighting.Map1:clone().Parent = game.Workspace wait(10) --Change this to the time between each map. Goes in seconds not minutes or hours. You can do min. or hrs. if u know how much seconds are on there. local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = ("Loading next map")--Change this to the title of the map. wait(4) msg:remove() game.Workspace.Map1:remove() wait(2) game.Lighting.Map2:clone().Parent = game.Workspace wait(10)--Change this to the time between each map. msg.Parent = game.Workspace msg.Text = ("Loading next map")--Change this to the title of the map. wait(4) msg:remove() game.Workspace.Map2:remove() wait(2) game.Lighting.Map3:clone().Parent = game.Workspace wait(10)--Change this to the time between each map. msg.Parent = game.Workspace msg.Text = ("Loading next map")--Change this to the title of the map. wait(4) msg:remove() game.Workspace.Map3:remove() wait(2) end
You can use GetDescendants() instead of GetChildren(). The difference is that GetDescendants() gets ALL of the contents (including other models inside the model) while GetChildren() only gets the model's contents you assigned to (only gets children to one model).
wait(5) local Descendants = MapModel:GetDescendants() for i = 1, #Descendants do local child = Descendants[i] if child:IsA("BasePart") then child.Anchored = false end emd
Well you could use a for loop (as far as i know)
Like this (assuming Map1 is already in workspace):
wait(5) for i,v in pairs (workspace.Map1:GetChildren()) do if v:IsA("BasePart") then -- to exclude decals and whatnot v.Anchored = false end end