ID:175980
 
in my game u have to get a certain amount of exp to level up and i cant get my stat panel to display my exp right it looks like this

stat("Experience:","[xp]/[num2text(xpneeded,100)]")
it wont display 100 or the xp i curently have
VegeanSX wrote:
in my game u have to get a certain amount of exp to level up and i cant get my stat panel to display my exp right it looks like this

stat("Experience:","[xp]/[num2text(xpneeded,100)]")
it wont display 100 or the xp i curently have

stat("Experience:","[num2text(round(usr.xp),100)]","[num2text(round(usr.xpneeded),100)]")


RaeKwon
In response to RaeKwon
it gives me an error report that says expecting 1 or 2 arguments (found 3)?
In response to VegeanSX
Whoops, RaeKwon. =P

&und(usr.xp),100)]/[num2text(round(usr.xpneeded),100)]")</ code>
In response to Crispy
one more question how would i get it to level up like when my exp reachs 100 it adds one to my level and restarts the exp back to 0 heres what ive got so far
obj
levelup
verb
levelup()
if(usr.xpneeded >= 100)
usr << "<font color = red>You level up!"
usr.level += 1
usr.xp = 0
else
return
In response to VegeanSX
VegeanSX wrote:
one more question how would i get it to level up like when my exp reachs 100 it adds one to my level and restarts the exp back to 0 heres what ive got so far
obj
levelup
verb
levelup()
if(usr.xpneeded >= 100)
usr << "<font color = red>You level up!"
usr.level += 1
usr.xp = 0
else
return
mob/proc
levelup()
if(src.xp >= src.xpneeded)
src << "
<font color = red>You level up!"
src.level += 1
src.xp = 0
else
return
</dm>
In response to VegeanSX
thats exactly it...cept u need to make it a proc and call it whenever you attack or gain exp
In response to Wanabe
crap its being gay and saying src.level += 1 is an invalid expression
In response to VegeanSX
VegeanSX wrote:
crap its being gay and saying src.level += 1 is an invalid expression

..well it is, space that line once, was an accident... [edit] i edited my other post with the fix[/edit]
In response to Wanabe
i spaced it and it still says that src.level += 1

In response to VegeanSX
AHHHHH i still cant get it to work
In response to VegeanSX
can someone help me with that problem
In response to VegeanSX
Don't bump your post.

Make sure you've got all the vars there defined.
In response to Crispy
Crispy wrote:
Whoops, RaeKwon. =P

&und(usr.xp),100)]/[num2text(round(usr.xpneeded),100)]")</ code>

Heh, my bad =| feeling rather idiotic latley =(

RaeKwon
In response to Crispy
how would i define that var
In response to VegeanSX
defining means telling the game the var like

mob
var
cheese
In response to Koolguy900095
one last question how do i get my stat thing stat("Experience:","[num2text(round(usr.xp),100)]/[num2text( round(usr.xpneeded),1000)]") to say Experience: 0/100
In response to VegeanSX
VegeanSX wrote:
one last question how do i get my stat thing stat("Experience:","[num2text(round(usr.xp),100)]/[num2text( round(usr.xpneeded),1000)]") to say Experience: 0/100

You can just use this: stat("exp:",[src.xp]/[src.xpneeded]"
In response to Wanabe
but how do i get it to say 100 do i have to make it a decimal or somthing??
In response to VegeanSX
You set it to 100. Read a tutorial why don't you! =P

<code>mob var somevarwitharandomname mob proc blah() somevarwitharandomname=100</code>
Page: 1 2