Leaderboard
Popular Content
Showing content with the highest reputation on 02/23/2022 in all areas
-
options: pickaxe: diamond pickaxe named "&4Pickaxe" with lore "&4Pickaxe" spawn: wither skeleton on break of obsidian: if player's held item is {@pickaxe}: chance of 25%: spawn {@spawn} at event-block send player title "&c&lOH NO!" with subtitle "&7A wither skeleton spawned" for 3 seconds Number 2 is simple1 point
-
I think you can just change the name of the server if that's easier for you1 point
-
1 point
-
1 point
-
1 point
-
when ever i put the ip in minecraft and try to join it says "invalid ip address" what?! WHY!?1 point
-
Hi bros and bro-ettes. I've seen multiple people go around, asking "HoW tO mAkE a CuStOm WhItElIsT sKrIpT?!?!" So today, I'm going to show you how to make a custom whitelist system with Skript. As an example, I'll show you how to disallow a player if they have offline for 10 minutes or more. If they've been offline for less than 10 minutes, let them in. Or else, get lost! It's simple, trust me What do we need??? • Command - Ofcouse we need a command for our custom whitelist system (/whitelist). • Player Connect Event - This event is called when the player successfully joins the server. Here you can kick/disallow the player for a reason. (on connect) • Player Quit Event - This event is called when the player leaves the server. Note that this is also called whenever the player is kicked from the server, e.g. causes like lag, /kick, /ban, etc. (on quit) How to??? Think about it... What can be done in the "on connect" event, what can be done with the "on quit" event, and how to whitelist? Simple! We will use "on connect" event to check if the server is whitelisted and calculate the time the players has been offline for. Disallow them if they have been offline for 10+ minutes or else let them in. We will use "on quit" event to set the timestamp at when they left! 3 things, 2 events, 1 command. Code them, and then pog! Things to keep in mind... • Add Permission To Bypass - Oh? Aren't you disallowing ALL players if they are 10 minutes late?! What if your fellow staff members are late?! Won't that tell them to "get lost"? That's rude and not cool at all... Simply check if player has permission, and bypass if they have. (Useful if you want to allow people with a rank to bypass) Coding Part Let's start with the events! Starting with on connect event first? on connect: # To check if the server is whitelisted (this variable will be modified in the command code) if {whitelist} is set: # We check here if player is allowed to bypass the whitelist ;) if player does not have permission "whitelist.bypass": # Just to make sure to not let player in if they're joining late for the first time if {lastdisconnect::%uuid of player%} is not set: kick the player due to "You're late! Get lost! (jk <3)" stop # We set a temp variable {_leavetime} which will calculate and store the amount of time player has been offline set {_leavetime} to difference between {lastdisconnect::%uuid of player%} and now # Check if the player is offline for more than 10 minutes if {_leavetime} is greater than 10 minutes: # Pretty rude kick message, but okay kick the player due to "You're late! Get lost! (jk <3)" delete {lastdisconnect::%uuid of player%} stop Now the on quit event! on quit: # Once again, just to extempt people with this permission if player does not have permission "whitelist.bypass": # This variable will store time when the player left! set {lastdisconnect::%uuid of player%} to now Sweet! We have our 2 events in place! Now let's do deh command. command /whitelist [<text>]: permission: whitelist.command permission message: &cNo bro, this command is not for you >:( trigger: if arg 1 is "on": if {whitelist} is not set: set {whitelist} to true broadcast "Whitelist was turned on! If you go offline for more than 10 minutes, you will not be able to join again! Panik" stop send "&cWhitelist is already turned on." else if arg 1 is "off": if {whitelist} is set: delete {whitelist} broadcast "Whitelist was turned off!" stop send "&cWhitelist is already turned off." else: send "&cUsage: /whitelist (on/off)" Done I guess? That's it! Okay, okay, want some more fancy stuff? Let's make it so that if the player joins in time, it will broadcast "<player> joined within <time> of leaving! Phew." We need another event for this. It's on join event! (Note that on join and on connect events are different) Here! on join: # Permission for extempting staff members if player does not have permission "whitelist.bypass": # Check if the last disconnect variable is set. This is to avoid the ugly <none> being put in the message >.> if {lastdisconnect::%uuid of player%} is set: # I hope you know what this is ;) (if not, go to the on connect event block) set {_timediff} to difference between {lastdisconnect::%uuid of player%} and now broadcast "&e%player% &fjoined back in &e%{_timediff}% &fafter leaving! Phew!!!" delete {lastdisconnect::%uuid of player%} Yay! This is just an example, you can change and create your own version. I'm not a native english speaker so might have embarrassing english mistakes >.> sorry. NOTE THAT I MADE THIS IN 10 MINUTES AFTER I WOKE UP. CODE QUALITY IS/MIGHT BE BAD. THE PURPOSE OF THIS IS JUST TO SHOW HOW TO MAKE A CUSTOM WHITELIST SKRIPT. THIS IS UNTESTED AND MIGHT HAVE STUPID MISTAKES AND BUGS. I WILL EDIT IT ONCE I TEST IT AND FIND BUGS.1 point
