Basically what I want to do is make random maps from the folder “Maps” duplicate into the Workspace and be placed at the loader’s specific position.
Here is the part of the script I am having trouble with:
Here is the error I keep getting in the output:
For some reason, it’s unable to replicate the map from RS. Any help would be appreciated. Thanks!
local Maps = game:GetService("ReplicatedStorage"):WaitForChild("Maps")
local loaderCount = 0
for i = 1, 9, 1 do
loaderCount = loaderCount + 1
local movetopos = workspace["Loader" .. loaderCount].Position
print(movetopos)
for i = 1, #maps do
local chosenmap = maps[math.random(1,#maps)]
local mapclone = chosenmap:Clone()
end
mapclone.Parent = workspace
mapclone:MoveTo(movetopos)
end
Try using this code. If it doesn’t work tell me the error
Hey again. The map duplicated normally:
However, it’s stacked multiple times and it is not placed on the loaders accordingly.
Here is the current script as it is right now:
Use cframes. Make a part and place it in the center of your map and make it the primary part. Then, use :SetPrimaryPartCFrame(movetopos) and make movetopos a CFrame
local Maps = game:GetService("ReplicatedStorage"):WaitForChild("Maps")
local loaderCount = 0
for i = 1, 9, 1 do
loaderCount = loaderCount + 1
local movetopos = workspace["Loader" .. loaderCount].CFrame
print(movetopos)
for i = 1, #maps do
local chosenmap = maps[math.random(1,#maps)]
local mapclone = chosenmap:Clone()
end
mapclone.Parent = workspace
mapclone:SetPrimaryPartCFrame(movetopos)
end