I am working on a Zombie RPG script and have the accounts down but im having trouble lvling up your skills, i have records containing each skill and its mana and skillpoint cost. But I am trying to use this code
if Players[ID].logged then begin
if getpiece(text,' ',0) = '/learn' then
if not getpiece(text,' ',1) = nil then begin
if getpiece(text,' ',1) = 'heal' then begin
if players[ID].heal < 3 then begin
if players[ID].spts >= heal.lvl1cost then begin
dec(players[ID].spts,heal.lvl1cost);
inc(players[ID].heal,1)
end;
end;
end;
end;
end;
but with this I would have to make a new one for every lvl is there any way to make it universal like this?
if Players[ID].logged then begin
if getpiece(text,' ',0) = '/learn' then
if not getpiece(text,' ',1) = nil then begin
if getpiece(text,' ',1) = 'heal' then begin
if players[ID].heal < 3 then begin
if players[ID].spts >= heal.lvl+(Players[ID].heal+1)+cost then begin
dec(players[ID].spts,heal.lvl+(Players[ID].heal+1)+cost);
inc(players[ID].heal,1)
end;
end;
end;
end;
end;
Thank you