Skip to content

Instantly share code, notes, and snippets.

@GrimEpp
Created April 2, 2020 12:03
Show Gist options
  • Select an option

  • Save GrimEpp/8680454d52175625b05af96fe4533820 to your computer and use it in GitHub Desktop.

Select an option

Save GrimEpp/8680454d52175625b05af96fe4533820 to your computer and use it in GitHub Desktop.
# _______________________________________________________________
# / \
# | Freeze skript made by GrimEpp |
# | This is a replacement for all the buggy skripts |
# | that uses buggy methods |
# | This method was taken from Pikachu's login skript |
# | You can use it. Repost it. Do whatever this method need |
# | to be used more often cause it is so smooth! |
# | Any bugs report them to me on forum or discord @GrimEpp#1115 |
# \_______________________________________________________________/
# Needs MundoSK, protocolSk, SKStuff
options:
#Options
Prefix: &cFreeze #Main prefix leave empty for no prefix
EnableBypass: false
Command: /ban %player% Logged out while frozen #Command console will execute when they get banned
#Messages
PlayerNotOnline: This player is not online!
ByPassPermissionMessage: You can not freeze this player!
InvalidUse: Invalid use of command! Use /freeze <Player>!
PermissionMessage: &cNo permission!
YouAreFreezed: You are freezed and can not do this!
PlayerFreezed: %Player% is freezed!
PlayerFreezed2: %Victim% is freezed!
YouCanNotFreezeYourSelf: You can not freeze yourself
PlayerFreezed: The player is not freezed!
PlayerNotFreezed: This player is not freezed!
InvalidUseUnFreeze: Invalid use! Use /unfreeze <Player>
#Permissions
ByPassPermission: bypass.freeze #Leave empty to disable bypass permission
Permission: command.freeze #Do not leave empty!
Permissionun: command.unfreeze
function freeze(p: Player):
make {_p} dismount
spawn 1 armor stand at location of {_p}
set {_s} to last spawned entity
add "{Invisible:1}" to nbt of {_s}
add "{NoGravity:1}" to nbt of {_s}
make {_p} ride {_s}
set {freeze::%{_p}%} to true
function unfreeze(p: Player):
delete {_p}'s vehicle
delete {freeze::%{_p}%}
on quit:
if {freeze::%player%} is true:
delete player's vehicle
make console execute command "{@Command}"
delete {freeze::%player%}
command /unfreeze [<offline player>]:
permission: {@Permissionun}
permission message: {@PermissionMessage}
trigger:
if arg-1 is set:
if arg-1 is online:
if {freeze::%arg-1%} is true:
unfreeze(arg-1)
else:
send "{@Prefix} {@PlayerNotFreezed}"
else:
send "{@Prefix} {@PlayerNotOnline}"
if arg-1 is not set:
send "{@Prefix} {@InvalidUseUnFreeze}"
command /freeze [<offline player>]:
permission: {@Permission}
permission message: {@PermissionMessage}
trigger:
if arg-1 is set:
if arg-1 is online:
if "%arg-1%" is not "%player's name%":
if {@EnableBypass} is yes:
if arg-1 has permission "{@ByPassPermission}":
send "{@Prefix} {@ByPassPermissionMessage}"
stop
else:
freeze(arg-1)
stop
else:
freeze(arg-1)
stop
else:
send "{@Prefix} {@YouCanNotFreezeYourSelf}"
else:
send "{@Prefix} {@PlayerNotOnline}"
stop
if arg-1 is not set:
send "{@Prefix} {@InvalidUse}"
on packet:
if event-string is "PacketPlayInSteerVehicle":
if {freeze::%player%} is true:
cancel the event
on click:
if {freeze::%player%} is true:
cancel event
send "{@YouAreFreezed}"
on damage:
if {freeze::%victim%} is true:
cancel event
send "{@PlayerFreezed2}"
if {freeze::%attacker%} is true:
cancel event
send "{@YouAreFreezed}"
on drop:
if {freeze::%player%} is true:
cancel event
send "{@YouAreFreezed}"
on pickup:
if {freeze::%player%} is true:
cancel event
send "{@YouAreFreezed}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment