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

Properties Script Thing?

Okay I am editing this script for a tycoon thing. I think I have the BrickColor area correct, but the problem is at the Material section(I think?. If someone could tell me what is wrong, I would appreciate it!

wait(2)
workspace:WaitForChild("PartStorage")

while true do
	wait(1.5) -- How long in between drops
	local part = Instance.new("Part",workspace.PartStorage)
	part.BrickColor = BrickColor.Bronze
	part.Material = Material.Marble
	local cash = Instance.new("IntValue",part)
	cash.Name = "Cash"
	cash.Value = 5 -- How much the drops are worth
	part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
	part.FormFactor = "Custom"
	part.Size=Vector3.new(1.2, 1.2, 1.2) -- Size of the drops
	part.TopSurface = "Smooth"
	part.BottomSurface = "Smooth"
	game.Debris:AddItem(part,20) -- How long until the drops expire
end

Thanks, Jiptix

2 answers

To be most technically correct, you should be using Enums when you're setting something that in Studio is a drop-down list:

wait(2)
workspace:WaitForChild("PartStorage")

while true do
    wait(1.5) -- How long in between drops
    local part = Instance.new("Part",workspace.PartStorage)
    part.BrickColor = BrickColor.new("Bronze")
    part.Material = Enum.Material.Marble
    local cash = Instance.new("IntValue",part)
    cash.Name = "Cash"
    cash.Value = 5 -- How much the drops are worth
    part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
    part.FormFactor = Enum.FormFactor.Custom
    part.Size=Vector3.new(1.2, 1.2, 1.2) -- Size of the drops
    part.TopSurface = Enum.SurfaceType.Smooth
    part.BottomSurface = Enum.SurfaceType.Smooth
    game.Debris:AddItem(part,20) -- How long until the drops expire
end

Note that part.BrickColor = BrickColor.new("Bronze") is not an Enum, it is a BrickColor constructor.

part.BrickColor = BrickColor.new("Bronze")

part.Material = "Marble"

What this does is it says part.Material = "The color but in a string" With the color, it gets a new BrickColor("String name of the color")

4 comments

0

Sorry about the script being formatting as text, I don't know how to fix :(

0

Ok thanks let me try it.

0

Still not working.

0

To get the script into the script form, click on the blue circle that says Lua. It should bring up 2 lines like this: ~~~~~~~~~~ and put the code in the middle of the lines (should be a gap between the lines)

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