Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Object not cloning to the place I want it to clone to? [SOLVED]

The spawn area isn't cloning.

local AvailableArea = game:GetService("ReplicatedStorage").SpawnPartsForCustomize


local chosenArea = AvailableArea:GetChildren()


local mathClonedArea = chosenArea[math.random(1, #chosenArea)]

local isAble = mathClonedArea:WaitForChild("IsFilled")

local clonedArea = mathClonedArea:Clone()
clonedArea.Parent = workspace




game.Players.PlayerAdded:Connect(function(plr)
	if isAble.Value == false then
	clonedArea.Name = plr.Name.."SpawnCustom"
	clonedArea.Anchored = true
	local cloneCustomArea = game.ReplicatedStorage.CustomIzeArea
	local cloned = cloneCustomArea:Clone()
	cloned.Name = plr.Name.."'s CustomizeArea"
	cloned.CloneBrickSpawn.CFrame = game.Workspace:FindFirstChild(plr.Name.."SpawnCustom").CFrame
	cloned.Parent = workspace
	wait(.1)
	mathClonedArea:Destroy()
	end
end)

1 answer

Well, since we talked in the chat, here's the code I came up with and how I explained it to you.

game.Players.PlayerAdded:Connect(function(plr)
	local AvailableArea = game:GetService("ReplicatedStorage").SpawnPartsForCustomize
	local chosenArea = AvailableArea:GetChildren()
	local mathClonedArea = chosenArea[math.random(1, #chosenArea)]
	
	local isAble = mathClonedArea:WaitForChild("IsFilled")
	local clonedArea = mathClonedArea:Clone()
	clonedArea.Parent = workspace
	
    if isAble.Value == false then
    clonedArea.Name = plr.Name.."SpawnCustom"
    clonedArea.Anchored = true

    local cloneCustomArea = game.ReplicatedStorage.CustomIzeArea
    local cloned = cloneCustomArea:Clone()

    cloned.Name = plr.Name.."'s CustomizeArea"
    cloned.CloneBrickSpawn.CFrame = game.Workspace:FindFirstChild(plr.Name.."SpawnCustom").CFrame
    cloned.Parent = workspace

    wait(0.1)
    mathClonedArea:Destroy()
    end
end)

Don't forget, if this worked select it as an answer so other people know it's been answered!

~killerbrenden

This discussion is preserved as it was. New answers, comments, and votes are closed.