Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This script is a currency script to allow the player to have a better experience by
- // selling various resources they obtain, saving money, and buying other objects for
- // their benefit.
- // Scripts do NOT save progress, enter in the amount of money you had last game, but don't
- // cheat, unless you're in a cheat-friendly world. Cheating is no no.
- // Minecraft Color Code symbol: §
- let home: Position = null//positions.createWorld(0, 60, 0) //remove "null" and the initial slashes to have a already set home
- let MONEY = 0//24375
- let tips = true // change 'true' to 'false' to disable the tips
- // do not change the values below
- let homer = 0
- mobs.onMobKilled(CHICKEN, function () {
- MONEY = MONEY + 5
- player.say("§2§l+$5§r for killing a chicken; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SHEEP, function () {
- MONEY = MONEY + 7
- player.say("§2§l+$7§r for killing a sheep; §6§l$" + MONEY)
- })
- mobs.onMobKilled(COW, function () {
- MONEY = MONEY + 8
- player.say("§2§l+$8§r for killing a cow; §6§l$" + MONEY)
- })
- mobs.onMobKilled(PIG, function () {
- MONEY = MONEY + 8
- player.say("§2§l+$8§r for killing a pig; §6§l$" + MONEY)
- })
- mobs.onMobKilled(COD, function () {
- MONEY = MONEY + 5
- player.say("§2§l+$5§r for killing a cod; §6§l$" + MONEY)
- })
- mobs.onMobKilled(MUSHROOM_COW, function () {
- MONEY = MONEY + 30
- player.say("§2§l+$30§r for killing a mooshroom; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SALMON, function () {
- MONEY = MONEY + 5
- player.say("§2§l+$5§r for killing a salmon; §6§l$" + MONEY)
- })
- mobs.onMobKilled(DROWNED, function () {
- MONEY = MONEY + 25
- player.say("§2§l+$25§r for killing a drowned; §6§l$" + MONEY)
- })
- mobs.onMobKilled(ZOMBIE, function () {
- MONEY = MONEY + 20
- player.say("§2§l+$20§r for killing a zombie; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SKELETON, function () {
- MONEY = MONEY + 30
- player.say("§2§l+$30§r for killing a skeleton; §6§l$" + MONEY)
- })
- mobs.onMobKilled(CREEPER, function () {
- MONEY = MONEY + 30
- player.say("§2§l+$25§r for killing a creeper; §6§l$" + MONEY)
- })
- mobs.onMobKilled(HORSE, function () {
- MONEY = MONEY + 8
- player.say("§2§l+$8§r for killing a horse; §6§l$" + MONEY)
- })
- mobs.onMobKilled(STRAY, function () {
- MONEY = MONEY + 32
- player.say("§2§l+$32§r for killing a stray; §6§l$" + MONEY)
- })
- mobs.onMobKilled(PHANTOM, function () {
- MONEY = MONEY + 30
- player.say("§2§l+$32§r for killing a phantom; §6§l$" + MONEY)
- })
- mobs.onMobKilled(PUFFERFISH, function () {
- MONEY = MONEY + 40
- player.say("§2§l+$40§r for killing a pufferfish; §6§l$" + MONEY)
- })
- mobs.onMobKilled(ZOMBIE_HORSE, function () {
- MONEY = MONEY + 100
- player.say("§2§l+$100§r for killing a zombie horse; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SKELETON_HORSE, function () {
- MONEY = MONEY + 50
- player.say("§2§l+$50§r for killing a zombie horse; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SILVERFISH, function () {
- MONEY = MONEY + 10
- player.say("§2§l+$10§r for killing a silver fish; §6§l$" + MONEY)
- })
- mobs.onMobKilled(WITHER_SKELETON, function () {
- MONEY = MONEY + 30
- player.say("§2§l+$30§r for killing a skeleton; §6§l$" + MONEY)
- })
- mobs.onMobKilled(WITHER, function () {
- MONEY = MONEY + 150
- player.say("§2§l+$150§r for killing an iron golem; §6§l$" + MONEY)
- })
- mobs.onMobKilled(BLAZE, function () {
- MONEY = MONEY + 50
- player.say("§2§l+$50§r for killing a blaze; §6§l$" + MONEY)
- })
- mobs.onMobKilled(ENDERMAN, function () {
- MONEY = MONEY + 50
- player.say("§2§l+$50§r for killing an enderman; §6§l$" + MONEY)
- })
- mobs.onMobKilled(BAT, function () {
- MONEY = MONEY + 3
- player.say("§2§l+$3§r for killing a bat; §6§l$" + MONEY)
- })
- mobs.onMobKilled(GUARDIAN, function () {
- MONEY = MONEY + 40
- player.say("§2§l+$40§r for killing a guardian; §6§l$" + MONEY)
- })
- mobs.onMobKilled(ELDER_GUARDIAN, function () {
- MONEY = MONEY + 250
- player.say("§2§l+$250§r for killing an elder guardian; §6§l$" + MONEY)
- })
- mobs.onMobKilled(HUSK, function () {
- MONEY = MONEY + 23
- player.say("§2§l+$23§r for killing a husk; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SEA_TURTLE, function () {
- MONEY = MONEY + 10
- player.say("§2§l+$10§r for killing a turtle; §6§l$" + MONEY)
- })
- mobs.onMobKilled(AnimalMob.Villager, function () {
- MONEY = MONEY - 60
- player.say("§4§lUhoh! -$60§r for killing a villager; §6§l$" + MONEY)
- })
- mobs.onMobKilled(ZOMBIE_VILLAGER, function () {
- MONEY = MONEY + 25
- player.say("§2§l+$25§r for killing a zombie villager; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SPIDER, function () {
- MONEY = MONEY + 15
- player.say("§2§l+$15§r for killing a spider; §6§l$" + MONEY)
- })
- mobs.onMobKilled(DONKEY, function () {
- MONEY = MONEY + 8
- player.say("§2§l+$8§r for killing a donkey; §6§l$" + MONEY)
- })
- mobs.onMobKilled(ENDERMITE, function () {
- MONEY = MONEY + 150
- player.say("§2§l+$150§r for killing an endermite; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SHULKER, function () {
- MONEY = MONEY + 60
- player.say("§2§l+$60§r for killing a shulker; §6§l$" + MONEY)
- })
- mobs.onMobKilled(SQUID, function () {
- MONEY = MONEY + 11
- player.say("§2§l+$11§r for killing a squid; §6§l$" + MONEY)
- })
- mobs.onMobKilled(POLAR_BEAR, function () {
- MONEY = MONEY + 15
- player.say("§2§l+$15§r for killing a polar bear; §6§l$" + MONEY)
- })
- mobs.onMobKilled(PANDA, function () {
- MONEY = MONEY - 100
- player.say("§4§lYou monster! -$100§r for killing a panda; §6§l$" + MONEY)
- })
- mobs.onMobKilled(RABBIT, function () {
- MONEY = MONEY + 7
- player.say("§2§l+$7§r for killing a rabbit; §6§l$" + MONEY)
- })
- mobs.onMobKilled(WOLF, function () {
- MONEY = MONEY + 15
- player.say("§2§l+$15§r for killing a wolf; §6§l$" + MONEY)
- })
- mobs.onMobKilled(CAT, function () {
- MONEY = MONEY + 8
- player.say("§2§l+$8§r for killing a cat; §6§l$" + MONEY)
- })
- mobs.onMobKilled(OCELOT, function () {
- MONEY = MONEY + 8
- player.say("§2§l+$8§r for killing an ocelot; §6§l$" + MONEY)
- })
- mobs.onMobKilled(PIG_ZOMBIE, function () {
- MONEY = MONEY + 30
- player.say("§2§l+$30§r for killing a zombie pigman; §6§l$" + MONEY)
- })
- mobs.onMobKilled(WITCH, function () {
- MONEY = MONEY + 30
- player.say("§2§l+$30§r for killing a witch; §6§l$" + MONEY)
- })
- mobs.onMobKilled(DOLPHIN, function () {
- MONEY = MONEY + 10
- player.say("§2§l+$10§r for killing a dolphin; §6§l$" + MONEY)
- })
- mobs.onMobKilled(LLAMA, function () {
- MONEY = MONEY + 10
- player.say("§2§l+$10§r for killing a llama; §6§l$" + MONEY)
- })
- mobs.onMobKilled(mobs.monster(MonsterMob.Vindicator), function () {
- MONEY = MONEY + 40
- player.say("§2§l+$40§r for killing a vindicator; §6§l$" + MONEY)
- })
- player.onChat(";gamble ", function (num1: number) {
- if (num1 <= 0 || num1 == null) {
- player.say("§4§lYou need to bet something to gamble you dum dum.")
- } else if (num1 > MONEY) {
- player.say("§4§lYou don't even have $" + num1 + "! Don't try to lie to me hoe.")
- } else {
- let roll1 = Math.randomRange(1, 12)
- let roll2 = Math.randomRange(1, 12)
- if (roll1 > roll2) {
- let roll3 = Math.randomRange(50, 150)
- let numof = Math.floor(num1 * (roll3 / 100))
- player.say("§2§l-----------------------------------")
- player.say("§2§l" + player.name() + "'s gambling game:")
- player.say("You rolled: §l" + roll1 + "§r | Bot rolled: §l" + roll2)
- player.say("Percent of bet won: §l" + roll3 + "%")
- player.say("You've won §2§l$" + numof)
- player.say("§2§l-----------------------------------")
- MONEY = MONEY + numof
- } else {
- player.say("§4§l-----------------------------------")
- player.say("§4§l" + player.name() + "'s gambling game:")
- player.say("You rolled: §l" + roll1 + "§r | Bot rolled: §l" + roll2)
- player.say("")
- player.say("You've lost §4§l$" + num1)
- player.say("§4§l-----------------------------------")
- MONEY = MONEY - num1
- }
- }
- })
- player.onChat(";balance", function () {
- player.say("You have §2§l$" + MONEY)
- })
- let temname = "Diamond"
- let nam = "diamond"
- let cos = 2200
- player.onChat(";cost/" + nam, function () {
- let cost = cos
- player.say("Item:§7§l " + temname)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + nam + " ", function (num1: number, num2: number) {
- let cost = cos
- let itemname = temname
- let cmd = "give @s " + nam
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + nam + " ", function (num1: number, num2: number) {
- let cost = Math.floor(cos / 1.5)
- let itemname = temname
- let cmd = "clear @s " + nam + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname2 = "Coal"
- let naaa2 = "coal"
- let cosss2 = 35
- player.onChat(";cost/" + naaa2, function () {
- let cost = cosss2
- player.say("Item:§7§l " + temname2)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa2, function (num1: number, num2: number) {
- let cost = cosss2
- let itemname2 = temname2
- let cmd = "give @s " + naaa2
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname2 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname2 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa2, function (num1: number, num2: number) {
- let cost = Math.floor(cosss2 / 1.5)
- let itemname2 = temname2
- let cmd = "clear @s " + naaa2 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname2 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname2 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname3 = "Iron Ingot"
- let naaa3 = "iron"
- let cmmd3 = "iron_ingot"
- let cosss3 = 225
- player.onChat(";cost/" + naaa3, function () {
- let cost = cosss3
- player.say("Item:§7§l " + temname3)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa3, function (num1: number, num2: number) {
- let cost = cosss3
- let itemname3 = temname3
- let cmd = "give @s " + cmmd3
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname3 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname3 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa3, function (num1: number, num2: number) {
- let cost = Math.floor(cosss3 / 1.5)
- let itemname3 = temname3
- let cmd = "clear @s " + cmmd3 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname3 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname3 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname4 = "Emerald"
- let naaa4 = "emerald"
- let cmmd4 = "emerald"
- let cosss4 = 750
- player.onChat(";cost/" + naaa4, function () {
- let cost = cosss4
- player.say("Item:§7§l " + temname4)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa4, function (num1: number, num2: number) {
- let cost = cosss4
- let itemname4 = temname4
- let cmd = "give @s " + cmmd4
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname4 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname4 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa4, function (num1: number, num2: number) {
- let cost = Math.floor(cosss4 / 1.5)
- let itemname4 = temname4
- let cmd = "clear @s " + cmmd4 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname4 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname4 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname5 = "Gold Ingot"
- let naaa5 = "gold"
- let cmmd5 = "gold_ingot"
- let cosss5 = 450
- player.onChat(";cost/" + naaa5, function () {
- let cost = cosss5
- player.say("Item:§7§l " + temname5)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa5, function (num1: number, num2: number) {
- let cost = cosss5
- let itemname5 = temname5
- let cmd = "give @s " + cmmd5
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname5 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname5 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa5, function (num1: number, num2: number) {
- let cost = Math.floor(cosss5 / 1.5)
- let itemname5 = temname5
- let cmd = "clear @s " + cmmd5 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname5 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname5 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname6 = "Obsidian"
- let naaa6 = "obsidian"
- let cmmd6 = "obsidian"
- let cosss6 = 175
- player.onChat(";cost/" + naaa6, function () {
- let cost = cosss6
- player.say("Item:§7§l " + temname6)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa6, function (num1: number, num2: number) {
- let cost = cosss6
- let itemname6 = temname6
- let cmd = "give @s " + cmmd6
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname6 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname6 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa6, function (num1: number, num2: number) {
- let cost = Math.floor(cosss6 / 1.5)
- let itemname6 = temname6
- let cmd = "clear @s " + cmmd6 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname6 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname6 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname7 = "Ender Pearl"
- let naaa7 = "enderpearl"
- let cmmd7 = "ender_pearl"
- let cosss7 = 1000
- player.onChat(";cost/" + naaa7, function () {
- let cost = cosss7
- player.say("Item:§7§l " + temname7)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa7, function (num1: number, num2: number) {
- let cost = cosss7
- let itemname7 = temname7
- let cmd = "give @s " + cmmd7
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname7 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname7 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa7, function (num1: number, num2: number) {
- let cost = Math.floor(cosss7 / 1.5)
- let itemname7 = temname7
- let cmd = "clear @s " + cmmd7 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname7 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname7 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname8 = "Cobblestone"
- let naaa8 = "cobblestone"
- let cmmd8 = "cobblestone"
- let cosss8 = 2
- player.onChat(";cost/" + naaa8, function () {
- let cost = cosss8
- player.say("Item:§7§l " + temname8)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa8, function (num1: number, num2: number) {
- let cost = cosss8
- let itemname8 = temname8
- let cmd = "give @s " + cmmd8
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname8 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname8 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa8, function (num1: number, num2: number) {
- let cost = Math.floor(cosss8 / 1.5)
- let itemname8 = temname8
- let cmd = "clear @s " + cmmd8 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname8 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname8 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname9 = "Oak Log"
- let naaa9 = "log"
- let cmmd9 = "log"
- let cosss9 = 6
- player.onChat(";cost/" + naaa9, function () {
- let cost = cosss9
- player.say("Item:§7§l " + temname9)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa9, function (num1: number, num2: number) {
- let cost = cosss9
- let itemname9 = temname9
- let cmd = "give @s " + cmmd9
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname9 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname9 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa9, function (num1: number, num2: number) {
- let cost = Math.floor(cosss9 / 1.5)
- let itemname9 = temname9
- let cmd = "clear @s " + cmmd9 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname9 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname9 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- let temname10 = "Book"
- let naaa10 = "book"
- let cmmd10 = "book"
- let cosss10 = 100
- player.onChat(";cost/" + naaa10, function () {
- let cost = cosss10
- player.say("Item:§7§l " + temname10)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa10, function (num1: number, num2: number) {
- let cost = cosss10
- let itemname10 = temname10
- let cmd = "give @s " + cmmd10
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname10 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname10 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa10, function (num1: number, num2: number) {
- let cost = Math.floor(cosss10 / 1.5)
- let itemname10 = temname10
- let cmd = "clear @s " + cmmd10 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname10 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname10 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- function shpp1() {
- let temname10 = "Golden Apple"
- let naaa10 = "goldenapple"
- let cmmd10 = "golden_apple"
- let cosss10 = 3700
- player.onChat(";cost/" + naaa10, function () {
- let cost = cosss10
- player.say("Item:§7§l " + temname10)
- player.say("--")
- player.say("Buy price: §2§l$" + cost)
- player.say("Sell price: §5§l$" + Math.floor(cost / 1.5))
- })
- player.onChat(";buy/" + naaa10, function (num1: number, num2: number) {
- let cost = cosss10
- let itemname10 = temname10
- let cmd = "give @s " + cmmd10
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (MONEY >= cost * num1) {
- if (num1 == 1) {
- player.say("You've bought: §l1§8§l " + itemname10 + "§r for $§l§2" + cost)
- MONEY = MONEY - cost
- player.execute(cmd)
- } else {
- player.say("You've bought: §l" + num1 + "§8§l " + itemname10 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY - cost * num1
- player.execute(cmd + " " + num1)
- }
- } else {
- player.say("§4§lYou don't have enough money!\n§rYou need $§4§l" + cost * num1 + "§r; You have: $§2§l" + MONEY)
- }
- })
- player.onChat(";sell/" + naaa10, function (num1: number, num2: number) {
- let cost = Math.floor(cosss10 / 1.5)
- let itemname10 = temname10
- let cmd = "clear @s " + cmmd10 + " 0"
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (3 == 3) {
- if (num1 == 1) {
- player.say("You've sold: §l1§8§l " + itemname10 + "§r for $§l§2" + cost)
- MONEY = MONEY + cost
- player.execute(cmd + " 1")
- } else {
- player.say("You've sold: §l" + num1 + "§8§l " + itemname10 + "s§r for $§l§2" + cost * num1)
- MONEY = MONEY + cost * num1
- player.execute(cmd + " " + num1)
- }
- }
- })
- }
- shpp1();
- // smelting
- function boof1() {
- let a_itemname1 = "Iron Ingot"
- let a_itemvalue1 = "iron"
- let a_cmdname1 = "iron_ore"
- let b_cmdname1 = "iron_ingot"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "s§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof1();
- function boof2() {
- let a_itemname1 = "Gold Ingot"
- let a_itemvalue1 = "gold"
- let a_cmdname1 = "gold_ore"
- let b_cmdname1 = "gold_ingot"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "s§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof2();
- function boof3() {
- let a_itemname1 = "Cooked Porkchop"
- let a_itemvalue1 = "pork"
- let a_cmdname1 = "porkchop"
- let b_cmdname1 = "cooked_porkchop"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "s§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof3();
- function boof4() {
- let a_itemname1 = "Cooked Beef"
- let a_itemvalue1 = "beef"
- let a_cmdname1 = "beef"
- let b_cmdname1 = "cooked_beef"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof4();
- function boof5() {
- let a_itemname1 = "Cooked Chicken"
- let a_itemvalue1 = "chicken"
- let a_cmdname1 = "chicken"
- let b_cmdname1 = "cooked_chicken"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof5();
- function boof6() {
- let a_itemname1 = "Cooked Mutton"
- let a_itemvalue1 = "mutton"
- let a_cmdname1 = "muttonraw"
- let b_cmdname1 = "muttoncooked"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof6();
- function boof7() {
- let a_itemname1 = "Cooked Salmon"
- let a_itemvalue1 = "salmon"
- let a_cmdname1 = "salmon"
- let b_cmdname1 = "cooked_salmon"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof7();
- function boof8() {
- let a_itemname1 = "Cooked Rabbit"
- let a_itemvalue1 = "rabbit"
- let a_cmdname1 = "rabbit"
- let b_cmdname1 = "cooked_rabbit"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof8();
- function boof9() {
- let a_itemname1 = "Cooked Salmon"
- let a_itemvalue1 = "salmon"
- let a_cmdname1 = "salmon"
- let b_cmdname1 = "cooked_salmon"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof9();
- function boof10() {
- let a_itemname1 = "Cooked Cod"
- let a_itemvalue1 = "cod"
- let a_cmdname1 = "fish"
- let b_cmdname1 = "cooked_fish"
- player.onChat(";smelt/" + a_itemvalue1, function (num1: number, num2: number) {
- if (num1 == 0 || num1 == null) {
- num1 = 1
- }
- if (num1 * 15 <= MONEY) {
- player.execute("clear @s " + a_cmdname1 + " 0 " + num1)
- player.execute("give @s " + b_cmdname1 + " " + num1)
- MONEY = MONEY - num1 * 15
- if (num1 != 1) {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- } else {
- player.say("Smelted §l" + num1 + " §7" + a_itemname1 + "§r for §2§l$" + num1 * 15)
- }
- } else {
- player.say("§4§lYou don't even have enough money to smelt that, idiot.")
- }
- })
- }
- boof10();
- player.onDied(function () {
- let math = Math.randomRange(0,25)
- if (math != 0) {
- let amountToLose = Math.floor(MONEY * (math/100))
- MONEY = MONEY - amountToLose
- player.say("§4Ouch! You dropped §l$" + amountToLose +"§r§4 when you died. You now have §6§l$"+MONEY)
- } else {
- player.say("§4You held onto your wallet as you vaporized! You dropped §6§l$0")
- }
- })
- player.onChat(";sethome", function () {
- player.say("§l§3Your home position has been set to §6(" + player.position().add(positions.create(0, 0, 0)) + ")")
- home = player.position().add(positions.create(0, 0, 0))
- })
- function gohome() {
- player.say("§lIt costs §2§l$500§r§l to fast travel back to your home, would you like to fast travel?")
- player.say("Reply with §2Yes§r§l or §4No§r§l.")
- player.onChat("yes", function () {
- if (homer == 1) {
- homer = 0
- if (home != null) {
- if (MONEY >= 500) {
- MONEY = MONEY - 500
- player.teleport(home)
- player.execute("playsound random.break @a ~ ~ ~ 5 0.6")
- player.say("You paid §2§l$500§r to teleport to §5§lhome§r. You now have §2§l$"+MONEY+".")
- } else {
- player.say("§4§lYou don't even have enough money to pay for your trip lmao.")
- }
- } else {
- player.say("§4§lYou don't even have a home dum dum.")
- }
- }
- })
- player.onChat("no", function () {
- if (homer == 1) {
- homer = 0
- player.say("§lOk, canceling.")
- }
- })
- }
- player.onChat(";gohome", function () {
- homer = 1
- gohome()
- })
- if (tips == true) {
- loops.forever(function () {
- loops.pause(120000)
- let math = Math.randomRange(0, 10)
- if (math == 0) {
- player.say("§7§lTip:§r§7 Coal is basically useless, just sell it and use the ;smelt command instead.")
- } else if (math == 1) {
- player.say("§7§lTip:§r§7 Gambling isn't always worth it, betting alot of money could result in a big loss!")
- } else if (math == 2) {
- player.say("§7§lTip:§r§7 Killing mobs yields lots of profit!")
- } else if (math == 3) {
- player.say("§7§lTip:§r§7 You can turn off these tips in the initial settings!")
- } else if (math == 4) {
- player.say("§7§lTip:§r§7 You can buy and sell cobblestone! No trash bin needed.")
- } else if (math == 5) {
- player.say("§7§lTip:§r§7 If you read this you're beautiful!")
- } else if (math == 6) {
- player.say("§7§lTip:§r§7 Combining villager trades and the shop could make you rich!")
- } else if (math == 7) {
- player.say("§7§lTip:§r§7 Items sell for 75% of their value.")
- } else if (math == 8) {
- player.say("§7§lTip:§r§7 Remember to budget items rather then spending all of your money immediatly!")
- } else if (math == 9) {
- player.say("§7§lTip:§r§7 If you need building supplies, buy logs from the shop!")
- } else if (math == 10) {
- player.say("§7§lTip:§r§7 You can also cook food with the ;smelt command!")
- }
- })
- }
Advertisement
Advertisement