Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mice = {}
- local shop = {
- -- NOMBRE - PRECIO
- {"Caja", 10},
- {"Pelota", 5},
- {"Yunque", 15}
- }
- function eventNewPlayer(name)
- if not mice[name] then
- mice[name] = {
- quesitos = 10,
- Caja = nil,
- Pelota = nil,
- Yunque = nil
- }
- end
- end
- for name,_ in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventTextAreaCallback(id, name, callback)
- for i=1,3 do
- if callback == shop[i][i] then
- if mice[name].quesitos <= shop[i][2] then
- print('Caja comprada correctamente')
- mice[name].quesitos - mice[name].quesitos - shop[i][2]
- mice[name].""..shop[i][1].."" = true
- end
- print(mice[name].quesitos)
- end
- end
- end
- for i=1,3 do
- print("<a href='event:"..shop[i][1].."'>"..shop[i][1].."</a>")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement