Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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

Log in to vote
1
Answered by
Redbullusa 1580 Moderation Voter
9 years ago

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

0
Thanks man! TixyScripter 115 — 9y
0
You're welcome. :) Redbullusa 1580 — 9y
Ad

Answer this question