ID:149831
 
here is my code


mob/hidden/verb/Mine()
usr.chanceofmining += rand(1,3)
if(usr.chanceofmining<=1)
usr << "You mannage to get some iron!"
usr.chanceofmining == 0
else if()

whenever i try to make it mine it comes up with
Objects.dm:210:error:rand:bad proc
Objects.dm:211:error::invalid expression

POOOn please help
Mrhat99au wrote:
here is my code


mob/hidden/verb/Mine()
usr.chanceofmining += rand(1,3)
if(usr.chanceofmining<=1)
usr << "You mannage to get some iron!"
usr.chanceofmining == 0
else if()

whenever i try to make it mine it comes up with
Objects.dm:210:error:rand:bad proc
Objects.dm:211:error::invalid expression

POOOn please help

I'd like to know exactly what you think

usr.chanceofmining == 0
and
else if()

are supposed to do.
In response to Lesbian Assassin
that is not all my script what happens is the users chance of mining is set randomly then if the players random number is below or above 1 it gets you some iron if not it tells you to go away then after that it resets the number so you can do it agian
In response to Mrhat99au
STILL DOES NOT WORK!
Lots of problems, I'll go through the ones I see.

mob/hidden/verb/Mine()
usr.chanceofmining += rand(1,3)
if(usr.chanceofmining<=1)

Here's the first problem, you should have no extra indentation after usr.chanceofmining += rand(1,3)

This is what your telling the compiler:

mob/hidden/verb/Mine()
usr.chanceofmining += rand(1,3)
{
if(usr.chanceofmining <= 1)
//rest of your code is here
}

It has no idea what your trying to do.

usr.chanceofmining == 0

Here's the second problem. This is a testing statment that returns a value. Testing statments should only be used in if, while, and for. The way you have it doesn't really do anything.

It's like walking into a room full of strangers then asking,"How are you all doing?" then running out of the room before they can answer, it doens't accomplish anything.

I think you want it like this:

usr.chanceofmining = 0

= is the assignment operator, it puts what is on the right into the variable on the left.

== tests the statements to see if they are equal, if they are equal it returns a 1, if they are not equal it returns a 0.

else if()

As LA said, the if() should contain some type of testing statment like this:

else if(usr.chanceofmining == 0)
In response to English
i just need some one to send back my script pronto with no errors because i am seriously pissed off
In response to Mrhat99au
You're pissed off? How do you think everyone else feels? Throwing together bits of code you don't understand randomly, getting angry that they don't work, and asking someone to make it work for you is no way to make a game.

You don't know how to write your own code, and no one here is going to code your game for you. If you want help on learning how to code, we'll help you learn. We aren't going to do your work for you, though.

English has explained what's wrong with your code... if you don't understand what he's telling you, then you shouldn't be trying to make a game yet anyway. Go read through the Guide and the Reference (links at the left) a few times... a few times more, if you've already read one. Go through some of the Demos and the Tutorials, line-by-line... look up the procs and operators being used in the reference, until you understand what each line does and how you can use the same procs and operators.
In response to Mrhat99au
Mrhat99au wrote:
i just need some one to send back my script pronto with no errors because i am seriously pissed off

I seriously doubt anyone is gonna want to help you more by this statement, think before you hit that post button!

LJR
In response to LordJR
SORRY PEOPLE! i mannaged to get it to work but you should play my game it is Aranum Death and Magik!
In response to Mrhat99au
God dont have a teary about it i know how to do things but its just those indention errors they are really pooey by the way i made that script myself so dont so i just pulled it from my arse ;)
In response to Mrhat99au
It's not just the indentation errors... it's the indentation errors, the syntax errors, the usage errors, the judgemental etc., etc., etc... I assure you, I'm not having a "teary"... the only emotions involved in my post are pity and an inexplicable desire to help you overcome your handicaps.

I've read all of your posts asking for help... and yes, it's clear that you do know something... almost enough to almost cobble together a game that almost works almost the way it's supposed to. Almost. As I see it, you have three alternatives:

1) You can keep coming here every ten minutes crying about your latest little problem...

2) You can start pulling code out of terminal end of your digestive tract, because that code is far more likely to work than the code you've produced so far.

3) You can stop rushing about, take time to think a little and learn a little.

Personally, I hope you pick choice #3, but you know, it's really up to you.
In response to Lesbian Assassin
i think id prefer 3 or 2 maybe but only if there is bigger prob i will send mail!
do you know any good dmi makers?
i need one for my game!
In response to Mrhat99au
Check the Classified Forums here. I hear the post in there.. myself being one of them. :P

LJR