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

How can I make this Dropper script Drop bricks with certain Properties?

So I am currently using this dropper script for my Tycoon:

wait(2)
workspace:WaitForChild("PartStorage")
while true do
	wait(0.5) -- How long in between drops
	local part = Instance.new("Part",workspace.PartStorage)
	part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
	local cash = Instance.new("IntValue",part)
	cash.Name = "Cash"
	cash.Value = 1 -- How much the drops are worth
	part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1,0)
	part.Size=Vector3.new(1,1,1) -- Size of the drops
	game.Debris:AddItem(part,20) -- How long until the drops expire
end

I am wondering how I can modify this script to make it change the material and the color. Also when the bricks are created to make money the have studs and inlets so I am wanting to know how to edit that also. If you can help me along the way into making this happen you can help in the Comments! THANKS!

-TixyScripter-

1 answer

To change the colors, materials, and/or surface types, just set the property of it.

Color Example

part.BrickColor = BrickColor.new("Bright yellow")
part.BrickColor = BrickColor.new(24)

Material Example

part.Material = "Ice"
part.Material = Enum.Material.Ice	-- I recommend using enumerations (enums) whenever possible
part.Material = 1536

Surface Type/Surface Constraint Example

part.TopSurface = Enum.SurfaceType.Smooth
part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
part.LeftSurface = Enum.SurfaceConstraint.Motor

Enumerations can be a number value or a string name.

Extra Source: Enumerations

2 comments

0

Thanks man!

0

You're welcome. :)

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