- Supported Skript Version
- 2.8
- Supported Minecraft Versions
- 1.20
Dependencies: Skript 2.8.4, skBee 3.4.3, skript-gui 1.3
How to use: Just drop the Generals.sk file in the folder at "*/plugins/Skript/scripts", then run the command "/sk reload Generals.sk". Once the script is loaded run the command "/generalshelp".
Useful Functions:
Toggle Fly Function:
Gamemode Set Function: (Requires {_p} to have {@permissionGamemode})
Regex Function, Formats numbers Ex. 987654321 = 987,654,321
How to use: Just drop the Generals.sk file in the folder at "*/plugins/Skript/scripts", then run the command "/sk reload Generals.sk". Once the script is loaded run the command "/generalshelp".
Useful Functions:
Toggle Fly Function:
Code:
#Fly Toggle Function
function flyToggle(p: player, 1: player):
#Fly on Self
if {_1} is not set:
if {_p} can fly:
make {_p} stop flying
disable flight for {_p}
delete {flight::%{_p}%}
send "{@prefix}&cFlight Disabled" to {_p}
else:
enable flight for {_p}
set {flight::%{_p}%} to true
send "{@prefix}&aFlight Enabled" to {_p}
#Fly on Others
else if {_p} has permission "{@permissionFly}.others":
if {_1} can fly:
make {_1} stop flying
disable flight for {_1}
delete {flight::%{_1}%}
send "{@prefix}&cFlight Disabled" to {_1}
send "{@prefix}&cFlight Disabled for &6%{_1}%" to {_p}
else:
enable flight for {_1}
set {flight::%{_1}%} to true
send "{@prefix}&aFlight Enabled" to {_1}
send "{@prefix}&aFlight Enabled for &6%{_1}%" to {_p}
#No Permission for Fly on Others
else:
send "{@permissionMessage}" to {_p}
Gamemode Set Function: (Requires {_p} to have {@permissionGamemode})
Code:
#Gamemode Function
function gamemodeSet(p: player, g: text):
if {_g} is "survival":
if {_p} does not have permission "{@permissionGamemode}.survival":
send "{@permissionMessage}" to {_p}
stop
set the gamemode of {_p} to survival
send "{@prefix}&aGamemode set to &6Survival" to {_p}
else if {_g} is "creative":
if {_p} does not have permission "{@permissionGamemode}.creative":
send "{@permissionMessage}" to {_p}
stop
set the gamemode of {_p} to creative
send "{@prefix}&aGamemode set to &6Creative" to {_p}
else if {_g} is "adventure":
if {_p} does not have permission "{@permissionGamemode}.adventure":
send "{@permissionMessage}" to {_p}
stop
set the gamemode of {_p} to adventure
send "{@prefix}&aGamemode set to &6Adventure" to {_p}
else if {_g} is "spectator":
if {_p} does not have permission "{@permissionGamemode}.spectator":
send "{@permissionMessage}" to {_p}
stop
set the gamemode of {_p} to spectator
send "{@prefix}&aGamemode set to &6Spectator" to {_p}
else:
send "{@prefix} &cThat is not a gamemode" to {_p}
Regex Function, Formats numbers Ex. 987654321 = 987,654,321
Code:
function regex(n: object) :: text:
if "%{_n}%" contains ".":
set {_s::*} to split "%{_n}%" at "."
set {_n} to "%regexA({_s::1})%.%last 2 characters of {_s::2}%"
return "%{_n}%"
else:
set {_n} to regexA("%{_n}%")
return "%{_n} ? 0%"
function regexA(b: text) :: text:
if length of {_b} > 3:
return "%regexA(first length of {_b} - 3 characters of {_b})%,%last 3 characters of {_b}%"
return {_b}