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

How do I change the tycoon Dropper Drop into Cookies?

Asked by 6 years ago

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?

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. TheLightningRises 56 — 6y
0
And then? Bastikekse 0 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

@TheArcticTerminal Ok

local part = Instance.new("Cookie")
part.Parent = Workspace

local clone = part:Clone()
print(clone.Parent)
--> nil

0
I don’t think you understand how Instance.new() works. Instance.new() only creates things Roblox made. User#20279 0 — 6y
0
Please know how to script Lua before you answer someone... DatOneRandomDude 69 — 6y
Ad
Log in to vote
0
Answered by
Elixcore 1337 Moderation Voter
6 years ago

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
0
He should just have the cookie in something and clone it. He doesn't need an Instance.new DatOneRandomDude 69 — 6y
0
true but he doesn't have it. Elixcore 1337 — 6y

Answer this question