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

How to make a Basic crafting system? [closed]

Asked by 6 years ago
Edited 6 years ago

I want a crafting system for my game where when you have to drag something from your hot bar or inventory, and then drop the item in a slot to craft a certain thing. For example: if you drag in a rock and a stick it will make a stone axe. Thank you.

Closed as Not Constructive by xAtom_ik, IcyEvil, TheeDeathCaster, and InfinitivePixelsJr

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Jo_Bot 67
6 years ago

The question was not asked with much detail, but I think I can answer.

So lets say you have 2 gui boxes, and you need to place an item in each, then the item is crafted. Crafting would require an inventory system most likely, so you would have it take the items you used to craft away from your inventory. The items would also need to be drag and drop, so each item would need a "Clicked" event, then have it stay on your cursor when the event is activated, then to drop it have an event on the 2 crafting gui boxes that is if you have selected an item and you have clicked it. Then the item would be parented to the crafting gui box. Inside a script there would be all of the models that you craft. Then have if statements constantly running, and have them check for the two items, for example:

if guiBox1.stick == true and guiBox2.rock == true then
    inventory.sticks.Amount.Value = inventory.sticks.Amount.Value - 1
    inventory.rocks.Amount.Value = inventory.rocks.Amount.Value - 1
    ax = script.Ax:Clone()
    ax.Parent = inventory

Something like this should work. Again, this is mostly concepts, not actually giving scripts, why would I just give you a script!?!?!?!?!

lol, I was bored...

0
Thank you :) xualex10 3 — 6y
Ad