ID:2709857
 
(See the best response by Lummox JR.)
NPC CODE:
        professor




ai()

interact(mob/m)
var/choice = m.prompt("Olá eu sou o PROFESSROR você quer comprar seus pontos hoje? Você tem [usr.money]", "Sim", "Nao")

while(choice == "Sim")

var/escolha = m.prompt("Em Qual Habilidade você quer distribuir 10 pontos? Você tem [usr.money]", "Forca", "Agilidade", "Defesa", "SAIR")
if(escolha == "Forca" && usr.money >= 10)
apower = power + 1
usr.money += -10
info_box.refresh()


if(escolha == "Agilidade" && usr.money >= 10)
apower = power + 10
usr.money += -10
info_box.refresh()

if(escolha == "Defesa" && usr.money >= 10)
apower = power + 10
usr.money += -10
info_box.refresh()

if(escolha == "SAIR")
break

return()


HUD CODE
InfoBox
parent_type = /HudBox

var
HudObject/title
HudObject/money
HudObject/experience
HudObject/class

New(mob/m)
..(m)

box(4, 2)

owner = m


title = add(12, 42, maptext_width = width * 32 - 24, layer = layer + 1)
class = add(12, 30, maptext_width = width * 32 - 24, layer = layer + 1)
money = add(12, 18, maptext_width = width * 32 - 24, layer = layer + 1)
experience = add(12, 6, maptext_width = width * 32 - 24, layer = layer + 1)

refresh()

pos(Constants.VIEW_WIDTH * Constants.ICON_WIDTH - 128 - 16, 16)

proc
refresh()
title.maptext = "<b>[owner.description()]</b>"
money.maptext = "Money: $[owner.money]"
experience.maptext = "XP: [owner.experience] / [owner.experience_needed]"
class.maptext = "Class: [owner.class]"

mob
var
tmp/InfoBox/info_box
tmp/last_move_time = 0

init_hud()
..()

if(client && Constants.USE_INFO_BOX)
info_box = new(src)

clear_hud()
..()

if(Constants.USE_INFO_BOX)
if(info_box)
info_box.hide()
del info_box


I'm trying to do a Skill Point NPC but i'm stuck in the hud refresh, to refresh the money in the hud

Best response
In the interact() verb, you're referring to info_box but that would be src.info_box which would be the NPC's, not the player who initiated the verb. You would need to refresh usr.info_box instead.