ID:145519
 
Code:
        Level(mob/characters/M in world)
set category = "GameMod"
var/amount = input("Level up how many times?") as num
while(amount > 0)
M.exp = M.maxexp
amount -= 1
M.level()


Problem description:Can Someone Please help me with this code it works but only on the person who has the verb i want to make it so i can level anyone in the game up mainly for Level 1 Moderators. Thanks.

Try changing mob/characters/M into mob/M. This is probably caused by the fact that you're the only one in the world that has a mob path of /mob/characters/M.
Try this
LEVELUP(mob/players/M in world)
set category = "GameMod"
var/levels = input("How many Levels?")as num
while (levels >=1)
if (istype(M,/mob/players))
M.exp+=(M.maxexp-M.exp)
level(M)
levels --
In response to Supanova
i tried using the code u gave him it has inconstant indentation
In response to Mxjerrett
Of course it did, you almost always get inconstant indentation when you copy/paste things of the forum.
In response to Mysame
i tried to fix it but i cant
In response to Mxjerrett
*sigh*. Seriously, if you can't fix an indendation problem, yet you posted about 6 topics already, then you should just quit everything. THAT or ATLEAST go out and READ something. DM Guide / Tutorials / Reference for all I care.
In response to Mysame
This might make a difference but im not certain... I saw once a post about pasting this into a blank .dm file then copy and pasting it from the new .dm file and into the main. Hope this helps.

verb
LEVELUP(mob/players/M in world)
set category = "GameMod"
var/levels = input("How many Levels?")as num
while (levels >=1)
if (istype(M,/mob/players))
M.exp+=(M.maxexp-M.exp)
level(M)
levels --
In response to Supanova
verb/LEVELUP(mob/players/M in world)
set category = "GameMod"
var/levels = input("How many Levels?")as num
for(var/I = 0, I<Levels, I++)
if(istype(M,/mob/players)) M.exp+=(M.maxexp M.exp); level(M)


I'm such a space-monger.
In response to Mechanios
Mechanios wrote:
> verb/LEVELUP(mob/players/M in world)
> set category = "GameMod"
> var/levels = input("How many Levels?")as num
> for(var/I = 0, I<Levels, I++)
> if(istype(M,/mob/players)) M.exp+=(M.maxexp M.exp); level(M)
>

I'm such a space-monger.

Show off :)

I know my coding is ugly, but hey, it works ;)