Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --# Wojbie's Xp Shoppe
- --# Uses touchpoint api
- --# http://pastebin.com/cRTsaYaK
- --# Uncomment next line to remove Op message spam
- --commands.exec("gamerule commandBlockOutput false")
- local Shop={}
- --# table.insert(Shop,{["name"]="Stone Brick",["price"]=1,["item"]="minecraft:stonebrick 64"})
- --#table.insert(Shop,{["name"]="Tin Gear",["price"]=5,["item"]="Railcraft:part.gear 1 3",}) --3 is damage value for basic tin gear
- --#table.insert(Shop,{["name"]="Tarma Root",["price"]=2,["item"]="arsmagica2:TarmaRoot 1"})
- --#table.insert(Shop,{["name"]="Stone Brick",["price"]=1,["item"]="minecraft:stonebrick 64"})
- --#table.insert(Shop,{["name"]="Stone",["price"]=100,["item"]="minecraft:stone 64"})
- table.insert(Shop,{["name"]="Diamond",["price"]=5,["item"]="minecraft:diamond 1"})
- table.insert(Shop,{["name"]="Mycelium",["price"]=1,["item"]="minecraft:mycelium 64"})
- table.insert(Shop,{["name"]="Soul Sand",["price"]=1,["item"]="minecraft:soul_sand 64"})
- table.insert(Shop,{["name"]="Thunder Hoe",["price"]=10,["item"]="framland:thunderhoe 1"})
- table.insert(Shop,{["name"]="Dev Null",["price"]=1,["item"]="danknull:dank_null_6 1"})
- table.insert(Shop,{["name"]="Blaze rods",["price"]=5,["item"]="minecraft:blaze_rod 16"})
- table.insert(Shop,{["name"]="Nether wart",["price"]=5,["item"]="minecraft:nether_wart 1"})
- table.insert(Shop,{["name"]="Slime ball",["price"]=1,["item"]="minecraft:slime_ball 1"})
- table.insert(Shop,{["name"]="Ender Pearl",["price"]=5,["item"]="minecraft:ender_pearl 16"})
- --# Default shop zone to CommandComputer coords
- local range = 5
- --# Load touchpoint api
- if not fs.exists("/touchpoint") then shell.run("pastebin get pFHeia96 /touchpoint") end
- os.loadAPI("touchpoint")
- --# Assuming that monitor is on top of commandComputer
- local t = touchpoint.new("top")
- --# Commands Backup
- --# give @p[lm=10,x=-532,y=69,z=1084,r=3] Railcraft:part.gear 1 3
- --# xp -10L @p[lm=10,x=-532,y=69,z=1084,r=3]
- local jump=false
- print("Adding "..#Shop.." Items to shop")
- for i,k in pairs(Shop) do
- local name = k.name.." = "..k.price.."L"
- print(name)
- t:add(name, function()
- --wiadomosc nie masz xp
- commands.exec("tellraw @p[l="..(k.price-1)..",r="..range.."] "..'["",{"text":"You don\'t have lvl for '..k.name..'","color":"red"}]')
- commands.exec("playsound mob.villager.no @p[l="..(k.price-1)..",r="..range.."]")
- --wiadomosc masz xp
- commands.exec("tellraw @p[lm="..k.price..",r="..range.."] "..'["",{"text":"Sold '..k.name.." for "..k.price..' lvl","color":"green"}]')
- commands.exec("playsound mob.villager.yes @p[lm="..k.price..",r="..range.."]")
- commands.exec("give @p[lm="..k.price..",r="..range.."] "..k.item)
- commands.exec("xp -"..k.price.."L @p[lm="..k.price..",r="..range.."]")
- t:flash(name)
- end , 3+25*(jump and 1 or 0), 2+2*math.floor((i-1)/2), 23+24*(jump and 1 or 0),2+2*math.floor((i-1)/2), colors.red, colors.lime)
- jump=not jump
- end
- t:run()
Advertisement
Add Comment
Please, Sign In to add comment