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

How do I change the tycoon Dropper Drop into Cookies?

I'm making a Tycoon and I want to change the Drop of my droppers into cookies, but they drop only bricks. Here is the script of the Dropper with the brick drop :

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=script.Parent.Parent.Parent.DropColor.Value
	part.Material=script.Parent.Parent.Parent.MaterialValue.Value
	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

Can someone change it, so it drops Cookies?

2 comments

0

Well first of you might want to keep your part in Replicated Storage. Second you need a cookie model and, you need a clone function.

0

And then?

2 answers

@TheArcticTerminal Ok

local part = Instance.new("Cookie")
part.Parent = Workspace
 
local clone = part:Clone()
print(clone.Parent)
--> nil

2 comments

0

I don’t think you understand how Instance.new() works. Instance.new() only creates things Roblox made.

0

Please know how to script Lua before you answer someone...

here you go, im not sure if this works but give it a try, i added a cookie mesh and texture inside a part using instance.new

simply change the script you have with this one below.

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=script.Parent.Parent.Parent.DropColor.Value
    part.Material=script.Parent.Parent.Parent.MaterialValue.Value
    local mesh = Instance.new("Mesh", part)
    mesh.MeshId = "http://www.roblox.com/asset/?id=20939848"
    mesh.TextureId = "http://www.roblox.com/asset/?id=21456464"
    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

2 comments

0

He should just have the cookie in something and clone it. He doesn't need an Instance.new

0

true but he doesn't have it.

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