I am still very new to javascript and while I understand parts of it their are things that are far beyond me this is one of them so any help would be nice.
Even a simple functioning script would be nice because honestly I doubt I know enough to even do it. I have searched but didnt find anything I could really use the way I need it to work.
Long story short I am making a simple click based website and I want to make it so if say someone clicks a rock they have a random chance of finding gold or something.
Then they can click the store and sell it to the store for coin which they can then in turn use to buy a flash light which is used to let them into a mine shaft.
Now I thought the best way to do this would be some cookie/javascript combo because I dont wanna use php I dont even have the basic understanding of it.
I couldnt even make a basic site in php last time I attempted it. I have already got a lot of the site done just this is one part I cant seem to figure out I have tried to make something many times.
That would function this way but I just dont have the skill to do it. Nothing that makes sense to me seems to work. <.< I can code games but I cant figure out javascript how sad am I!.... Any help would be wonderful.

Thanks in advance and if no one is willing to help me I totally understand. :P