How to make a rake Flare system

BASICALLY , when you press a flare , “tool” a crate will drop and when you open the crate a gui with 6 image labels with 6 random tools will be inside. every time the drop drops different items will be inside

2 Likes

first, make a supply drop and use math.random for the items,
then put the supply drop in replicated storage, then make a folder in workspace with parts for locations the supply drop could drop at,
then with the flare gun tool, once it’s activated (through a server script, if you want it through a local script, use a remote event) move the supply drops parent to workspace and set its x,z position to the parts it could drop at, then set the y position to something high (or you could use math.random) then you could tween the drop down

i known the dropping part but not the random tools

You can make a table consisting of the tools.

When you opened the crate, it will search through the table with this method:

local droppables = {"gun", "crowbar", "weapon"}

droppedTool = droppables[math.random(1, 3)) -- 3 is the amount of tools inside the table

If the tools are located within the replicatedstorage, we can just clone the tool and grant the player the tool.

local droppables = {"gun", "crowbar", "weapon"}

local droppedTool = droppables[math.random(1, 3)) -- 3 is the amount of tools inside the table

local toolToBeGranted = replicatedstorage:FindFirstChild(droppedTool)

if toolToBeGranted then
   --script here
end

If you’re doing a completely random tool drops, use math.random. If you want to have different tool rarities in which the chances to find the lowest rarity tier is much more common and highest rarity tier will be rarer, then you should try another method.

1 Like

How would i put this in a gui also do you have discord?

Not sure what you mean by that, and yes I do have discord. sinetric#5848, or you can contact my other account Mememoxzine#9290

Okay i send you a friend request

I would suggest using simulated OOP for this, its a prime example for using such methods especially to help clean up code, however, you can just pick a random index in a table. This would be the simplest method of going about this.

I’m not in the mood for arguing with people about the proper uses of metatables or proxys, don’t bother; it’s really not up for debate.