So I'm making an RPG game that involves mining. Once a player mines an iron vein he/she receives a tool. That tool is called "IronOre". It's a tool that is composed of simply a handle and that's it. I want to make a furnace that has a brick. Now I want that brick to have a "clickdetector" so a player can click on the block and a gui will pop up and the player can select an option that will "smelt" the "IronOre" into an "IronBar". I have no idea on how to do this xD Please help? I will be very grateful for your kindness.!
I already have the block with click detector and the gui and stuff.
What I tried putting inside of my button that is inside of my gui. (i know it was a complete fail :( but what do i do? oh and by the way, the "IronOre" and "IronBar" are in Lighting):
function Onclicked () if player.Backpack.("IronOre") then player.Backpack.destroy ("IronOre") and give.player.Backpack ("IronBar") end end
--Put this in the brick that is the furnace brick script.Parent.ClickDetector.MouseClick:connect(function(player) if player.Backpack.IronOre then player.Backpack.IronOre:Destroy() --Put your ironbar tool in lighting ModelCopy=game.Lighting.IronBar:Clone() ModelCopy.Parent=plr.Backpack --Im just a novice, if it doesn't work just say and I will remove this.