Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

I'm stumped, can someone help me write a code?

Discussion in 'Scripting' started by eric56379, Jul 21, 2014.

  1. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    Hi, I am sorry, for asking people to make a script for me. I feel guilty!

    But I have 3 trees. They are labeled tree_1, tree_2, and tree_3. I would like to have a script where if you click near the tree, you get one wood every 1 second. And you get up to 5 wood every tree. When you get all the trunks, it would disappear. Then it would come back in 10 minutes (600 seconds).

    I would also like to use this script for when you click on something, you get it in your inventory, with any name I assign it to. For example: If I find this thing called stone, and click on it, I would get one stone every second and it would disappear when I get 5 stones, and it would come back in 10 minutes (600 seconds).

    So in a nutshell: It's basically like chopping down wood in minecraft.

    THANKS!!!

    P.S. For the image, lets just say I want to collect stone from the rocks, and collect wood from trees, using the same script, and for me to get rock using a tree script, I would just change the words in the coding.
     

    Attached Files:

  2. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,716
    And... what have you tried? Post some snippet of your code so we can help with a specific issue, because people won't do your job for you.
     
  3. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    Nope, I've been trying to code this all day and I cannot get it right. Goodbye, thought the community helps people instead of slapping me in the face and lick my computer until its brown.
     
  4. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    The community helps people that help themselves.

    The community is not a code charity