Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## score2points
- xp set @s 0 points
- xp set @s 129 levels
- execute if score in math matches 512.. run xp add @s 512 points
- execute if score in math matches 512.. run scoreboard players remove in math 512
- execute if score in math matches 256.. run xp add @s 256 points
- execute if score in math matches 256.. run scoreboard players remove in math 256
- execute if score in math matches 128.. run xp add @s 128 points
- execute if score in math matches 128.. run scoreboard players remove in math 128
- execute if score in math matches 64.. run xp add @s 64 points
- execute if score in math matches 64.. run scoreboard players remove in math 64
- execute if score in math matches 32.. run xp add @s 32 points
- execute if score in math matches 32.. run scoreboard players remove in math 32
- execute if score in math matches 16.. run xp add @s 16 points
- execute if score in math matches 16.. run scoreboard players remove in math 16
- execute if score in math matches 8.. run xp add @s 8 points
- execute if score in math matches 8.. run scoreboard players remove in math 8
- execute if score in math matches 4.. run xp add @s 4 points
- execute if score in math matches 4.. run scoreboard players remove in math 4
- execute if score in math matches 2.. run xp add @s 2 points
- execute if score in math matches 2.. run scoreboard players remove in math 2
- execute if score in math matches 1.. run xp add @s 1 points
- execute if score in math matches 1.. run scoreboard players remove in math 1
- xp set @s 5 levels
- #level2points
- ######################################################
- # calculate experience points required for that level
- #
- # xp = | 2*l + 7; [0,16]
- # | 5*l - 38; [17-31]
- # | 9*l - 158; [32,inf]
- ######################################################
- scoreboard players operation out math = in math
- execute if score in math matches 0..16 run scoreboard players operation out math *= #2 constant
- execute if score in math matches 17..31 run scoreboard players operation out math *= #5 constant
- execute if score in math matches 32.. run scoreboard players operation out math *= #9 constant
- execute if score in math matches 0..16 run scoreboard players add out math 7
- execute if score in math matches 17..31 run scoreboard players remove out math 38
- execute if score in math matches 32.. run scoreboard players remove out math 158
- #scoreboard players operation out math *= in1 math
- #scoreboard players operation out math /= #100 constant
Advertisement
Add Comment
Please, Sign In to add comment