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

Is there a way I can make my dropper script shorter?

Hey! I was just wondering if I can make this script I wrote, more simple?

x = 1
y = 1
z = 1

function drop()
	local Dropped = Instance.new("Part")
	Dropped.Position = script.Parent.Position
	Dropped.Size = Vector3.new(x, y , z)
	Dropped.BrickColor = BrickColor.new("Beige") 
	Dropped.TopSurface = "Smooth"
	Dropped.BottomSurface = "Smooth"
	Dropped.Name = "Block"
	Dropped.Parent = script.Parent
	Dropped.Massless = true
	Dropped.Anchored = false
end

while true do
	wait(3)
	drop()
end

Thanks!

2 comments

0

Is there any reason to make it shorter? just asking

2

for the varibles at the top try this: x, y, z = 1, 1, 1

1 answer

✓ Accepted answer

Actually, instead of instancing you can make a pre existing part and clone it.

local dropped_sample = script.Dropped -- assuming the part is a child of the script

local function drop()
	local dropped = dropped_sample:Clone()
		dropped.Parent = script.Parent
end

while wait(3) do
	drop()
end

1 comment

1

and it is probably more performance wise better too

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