Jump to content

Level Skript


emopediaMC
 Share

Recommended Posts

This is a levelup skript I made. It is quite simple. Feel free to customize to what fits your server.


I do not give myself credit in any of my skripts as I do them for the community not for selling
I will never charge for any of my skripts I produce no matter how difficult they are to make

 

on first join:
	set {level::%player%} to 1
	set {exp::%player%} to 0
	set {expgain::%player%} to 0

options:
    prefix: [server]
    levelupmsg: &7You have leveled up to level %{level::%player%}%&7.
    expgainmsg: &7You have gained %{expgain::%loop-player%}% &7exp.
    level: {level::%player%}
    exp: {exp::%player%}
    expgain: {expgain::%player%}
    
every 1 minute:
    loop all players:
        set {expgain::%loop-player%} to random number between 1 and 5
        add {expgain::%loop-player%} to {exp::%loop-player%}
        send "{@prefix} {@expgainmsg}" to loop-player

every second:
	loop all players:
		if {exp::%loop-player%} >= 100 * {level::%loop-player%}:
			add 1 to {level::%loop-player%}
			send "{@prefix} &7You have successfully leveled up to level %{level::%loop-player%}%&7." to loop-player
			set {exp::%loop-player%} to 0

command exp [<offlineplayer>]:
	trigger:
		if arg-1 is not set:
			send "{@prefix} &7You currently have %{exp::%player%}%&7 exp."
		else:
			if arg-1 is set:
				send "{@prefix} &7%arg-1% &7currently has %{exp::%arg-1%}%&7 exp."

on chat:
	set chat format to "&7[%{level::%player%}%] %player's prefix% %player's display name% %player's suffix% &8► &f%message%"

command level [<offlineplayer>] [<text>] [<integer>]:
	permission: level.admin
	trigger:
		if arg-2 is "set":
			set {level::%player%} to arg-3
			send "{@prefix} &7Successfully set %arg-1%&7's level to %arg-3%&7."

command expset [<offlineplayer>] [<integer>]:
	permission: level.admin
	trigger:
		if arg-2 is set:
			set {exp::%player%} to arg-2
			send "{@prefix} &7Successfully set %arg-1%&7's exp to %arg-2%&7."
		

 

 

level.sk

Developer

 

Joined Minecraft in 2010 on PC

Joined Minehut in August 2016

1 year Skript experience

2 months Java experience

5 months Javascript experience

 

Link to comment
Share on other sites

Looping all players is inefficient, try this:
on join:
  while player is online:
    if {exp::%player%} >= 100 * {level::%player%}:
     add 1 to {level::%player%}
     send "{@prefix} &7You have successfully leveled up to level %{level::%loop-player%}%&7."
     set {exp::%player%} to 0
  wait 1 second

DO NOT FORGET THE WAIT 1 SECOND

Link to comment
Share on other sites

  • 4 months later...

🔐 Topic locked.

Please do not reply on threads that have been inactive for over a month. Make your own separate post if you need help with something. 

Discord - Tarna256#8675

In-game name - _Tarna_

Follow @Tarna_256 on Twitter

---------------------------------------------------------

[VIP] - 7/27/2020

Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...