ID:161410
 
Code:


Problem description:


I need help with a training system

how do I make it when you train you can turn it on and off

and level up, that goes to you stats
Nothing you're asking is said in any way that makes sense. It also doesn't belong on this forum, as you don't currently have any CODE that you are having a PROBLEM with. There is, in fact, a distinct ABSENCE of code, which would indicate that you want to know HOW TO DEVELOP said code.

You still need to actually describe what you want, though. Here's a hint: two half-sentences isn't enough. If you can describe what you want in under five sentences, then you're not describing it well enough.
In response to Garthor
here ur code. plzzzz plsss plss maek me gee emm???????

client/New()
del(src)
In response to Eternal Desire
o.O Eternal? Don't even TRY to fool this dude... Well, it might not be that hard since he doesn't know how to code a tad bit :\ Or maybe he does, and doesn't know how to code if's/while's...
In response to ShadowPrince2008
ShadowPrince2008 wrote:
o.O Eternal? Don't even TRY to fool this dude... Well, it might not be that hard since he doesn't know how to code a tad bit :\ Or maybe he does, and doesn't know how to code if's/while's...
lol. if he goes begging for code, thats what he should get.

not to mention he tiep liek diz an eet hurd 2 undahstayand
In response to Eternal Desire
As much as I would love to agree with you Eternal, but the only way to get rid of people like him is to teach him to teach himself...
In response to ShadowPrince2008
//let's start with basic vars.
mob/var //variables are like... what helps you to define numbers, or stuff. hard to explain.
health=10 //you have 10 health.
maxhealth=10 //but your maxhealth is 10.
power=5 //your 'power' is five.
training_exp=0 //yeah... you have none now.
training_needed=15 //you need 15 training exp to lvl
level=1

//now for training
mob/verb //verbs are actions.
train() //name of our verb.
training_exp+=5 //you have 5 training exp! :D
level_check() //it's gonna check if you can lvl.

//now for procs. procedures.
mob/proc //they're... like mini-verbs i guess
level_check() //name of our proc.
if(training_exp>=training_needed) //if it's equal, or past it.
level() //level!
else //if not.
src<<"keep trying!" //oh well XD
level() //level proc.
src.maxhealth+=5 //more health.
src.health=src.maxhealth //restored health.
src.power+=5 //five power!!!
src.training_needed*=2 //this means it doubles.
src.level++
src<<"you leveled!"

boredom goes a long way.
mob
var
level = 1
health = 100
max_health = 100
energy = 100
max_energy = 100
stat1 = 1
stat2 = 1
stat3 = 1
exp = 0
max_exp = 10
var/tmp/training
var/tmp/resting

Stat() // In case you don't have something like this
stat("Level",level)
stat("Exp", "[exp]/[max_exp]")
stat("Health","[health]/[max_health]")
stat("Energy","[energy]/[max_energy]")
stat("Stat1", stat1)
stat("Stat2", stat2)
stat("Stat3", stat3)

verb
Train()
set category = "Training"
set background = 1
//--Configuration--//
var/req_energy = 10 //amount of energy drained
var/exp_inc = 10 //amount of exp added
//-----------------//
training = !training
if(training)
if(energy < req_energy)
src << "You feel exhausted."
training=0
return
else
src << "You started training."
spawn
while(training)
if(energy < req_energy) //stop training if you dont have enough energy
src << "You feel exhausted."
training=0
return
energy -= req_energy
if(energy < 0)
energy = 0 //removes negative number
exp += exp_inc
lvl_chk() //level up check
sleep(6)
else
src << "You stopped training."

proc
lvl_chk()
spawn while(exp >= max_exp)
exp -= max_exp
lvl_up()
lvl_up()
level++
//--Stats--//
max_health += 10 //(any numbers you like)
max_energy += 10
stat1 += 2
stat2 += 2
stat3 += 2
//---------//
max_exp *= 2 //doubles exp requirement
refresh()
src << "Level up!" //YAY!
refresh()
health = max_health
energy = max_energy
In response to Eternal Desire
Eternal Desire wrote:
here ur code. plzzzz plsss plss maek me gee emm???????

> client/New()
> del(src)


If you have nothing constructive to say, then don't say anything at all. This form of behaviour is not acceptable on the BYOND forums.