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

in my script why does the part created by it disappear after the script tries to create a new one?

local Part = Instance.new("Part")
while true do
	wait(1)
	Instance.new("Part")
	Part.Size = Vector3.new(10, 10, 1)
	Part.CFrame = CFrame.new(50, 50, 50)
	Part.Parent = workspace
	Part.Name = "brick probaluy"
	print("part created")
	wait(1)
end

does anyone know what i have done wrong?

1 comment

0

There is a variable called Part, on line 4 I think you mistaked cloning the variable and instead cloned the base object. Try local Part = Instance.new("Part") on line 4, replace the whole thing

1 answer

✓ Accepted answer

on the top of your script, you create the "Part" variable containing a Part Instance then in your while loop you are changing the "Part" properties, not the new part properties (the one created in your while loop)

you have to do :

local Part = Instance.new("Part")

while true do
	wait(1)
	local newPart = Instance.new("Part")
	newPart.Size = Vector3.new(10,10,1)
	newPart.CFrame = CFrame.new(50,50,50)
	newPart.Name = "the name you want"
	newPart.Parent = workspace
	print("part created")
end

1 comment

0

thanks for the help! it now works.

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