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

Make block destroyable and after its destroys drops an item?

How would i go about making a block drop an item, for example if you break a tree it drops logs and rocks drop minerals etc etc.

thanks in advance, Benmz41998

1 answer

You can clone the "drop" item near the location of the "dropper".

e.g.

local drop = game.ReplicatedStorage.WoodDrop
local r = math.random --To shorten the code

--something happens
local d = drop:Clone(); --Clone item
local origin; --Define cframe of area to clone
local offset = CFrame.new(r(-5,5),5,r(-5,5)); --Define offset
d.CFrame = origin * offset;
d.Parent = workspace;

1 comment

1

EYYYYYYYY ITS GOULSTEM

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