Help on this dropper script

Hi, so I found a script on the Roblox Developer Forum to help me with my dropper in a tycoon game. I am not a scripter so this is already quite complicated to me lol… My question is, how would I go about editing this script to drop a mesh I have named “Item”. Here is the script:

local Dropper = game.Workspace.Building.Droppers.Dropper1.Dropper

local function MakeBlock()
local Block = Instance.new(“Part”)
Block.Parent = workspace
Block.CFrame = Dropper.CFrame
Block.Size = Vector3.new(2, 1, 2)
Block.Material = Enum.Material.Concrete
Block.BrickColor = BrickColor.new(“White”)
game.Debris:AddItem(Block, 5)
end

while true do
if script.Parent.Parent.M1.Transparency == 0 then
task.wait(1)
MakeBlock()
end

task.wait()
end

Thank you for the help!

where is “Item” Stored?

1 Like

Instead of creating a new part, simply clone the object you want to use.

2 Likes

The Item is currently in workspace.

Could I do that and still have it drop?

Sure, just make sure you unanchor the object after you clone it (if it’s anchored).

If you’re working with models, you’ll have to weld everything within that model together or it will just fall apart once you unanchor.

1 Like

Ok I see thank you. Just one more question though, do I need to set the position of the cloned item?

Probably, unless the model already has the position you want.

1 Like

Ok thank you very much for your help!

1 Like

Hey I know I’m asking even more lol, but could you tell me what I am doing wrong with this script? Whenever I run the script the item just falls through the floor and the main item I have doesn’t clone itself anymore. Here is the script:

local Dropper = game.Workspace.Building.Droppers.Dropper1.Dropper

local Item = script.Parent.Item

while true do
if script.Parent.Parent.M1.Transparency == 0 then
Item:Clone()
Item.Anchored = false
Item.Transparency = 0
Item.Parent = game.Workspace
wait(1)
end

end

Is CanCollide and Anchored on or off for the main part? Also I’m assuming this is not a model.

1 Like

Oh wait, I just realised what you’re doing. Item:Clone() returns the clone, so you would need to do something like:

local clone = Item:Clone()
clone.Anchored = false

(and so on)

Remember, you don’t want to modify the main part or it’ll mess up future clones.

1 Like

Awesome Ill try that out thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.