Jump to content
Sign in to follow this  
ProfCube

GameMode Skript

Recommended Posts

Posted (edited)

This is just a very cheesy Skript for people who just want to make it. But don't feel like making it at all XD
So I made it out of love and care and a lot of bars of soap banging on peoples heads ūü§™
I know scripts can be improved in many ways but I like it this way ūüėĄ¬†but please still tell me if can still improve ūüėĄ¬†

Permission
	x-core.*
	x-core.gamemode
	x-core.gamemode.survival
	x-core.gamemode.survival.others
	x-core.gamemode.creative
	x-core.gamemode.creative.others
	x-core.gamemode.adventure
	x-core.gamemode.adventure.others
	x-core.gamemode.spectator
	x-core.gamemode.spectator.others
Commands
	/gamemode <player> Survival | Creative | Adventure | Spectator


GameMode.sk

Edited by ProfCube

Share this post


Link to post
Share on other sites

You should use functions for gamemodes, it helps prevent multiple lines.

You can do "{@perm}.gamemode.%arg-1%" instead of typing it out, it saves time.

You didn't have to add multiple stops in the skript if you don't have it looped.

You didn't have to add "{@perm.gamemode.<gamemode>.others}". It will flow through if the player has access to the gamemode.

I changed the skript around a little better. The main problem is that you have to actually add permission to the shortcuts. (gamemode.0 or gamemode.survival)

If you want me to send improvements on the skript here then just reply to this message!

Share this post


Link to post
Share on other sites
5 hours ago, Dextur said:

You should use functions for gamemodes, it helps prevent multiple lines.

You can do "{@perm}.gamemode.%arg-1%" instead of typing it out, it saves time.

You didn't have to add multiple stops in the skript if you don't have it looped.

You didn't have to add "{@perm.gamemode.<gamemode>.others}". It will flow through if the player has access to the gamemode.

I changed the skript around a little better. The main problem is that you have to actually add permission to the shortcuts. (gamemode.0 or gamemode.survival)

If you want me to send improvements on the skript here then just reply to this message!

I know I could use functions, but I made it simple and understanding for most people who start out to use Skript.
 

If I had used "{@perm}.gamemode.%arg-2%" that would have given a little more problem since I would have to make sure that they can actually run it ass well with 1, 2, 3 or a, c, s or creative, survival, adventure 

Well if I didn't use multiple lines for the stop, it wouldn't register the command when you are giving it to the other player

I added it just incase people wanted to only have it for specific players.

post the Skript you ranged

Share this post


Link to post
Share on other sites

Rodger that, with the gamemode.others case, I just made it into one command. But the problem with mines is you have to add perms to the shortcuts (/gamemode s or 2). I could've turned it into "survival" or "creative" to make things easier. But this is just a demo of mines. Your skript is pretty nice though.

options:
    perm: x-core
    noperm: &cYou currently don't have permission to run this command!

function gamemode(p: player, gamemode: text):
    if {_gamemode} is "survival","0" or "s":
        set gamemode of {_p} to survival
        send "&7Your gamemode has been set to &eSurvival" to {_p}
    if    {_gamemode} is "creative","1" or "c":
        set gamemode of {_p} to creative
        send "&7Your gamemode has been set to &eCreative" to {_p}
    if {_gamemode} is "adventure","2" or "a":
        set gamemode of {_p} to adventure
        send "&7Your gamemode has been set to &eAdventure" to {_p}
    if {_gamemode} is "spectator","3" or "sp":
        set gamemode of {_p} to spectator
        send "&7Your gamemode has been set to &eSpectator" to {_p}
command /gamemode [<text>] [<offline player>]:
    permission: {@perm}.gamemode
    permission message: {@noperm}
    aliases: gm
    trigger:
        if arg-1 isn't set:
            send "&7/gamemode &e<text> <player>"
        else:
            if arg-1 isn't "survival","0","s","creative","c","1","adventure","2","a","spectator","3" or "sp":
                send "&7This gamemode is unknown."
            else:
                if player has permission "{@perm}.gamemode.%arg-1%":
                    arg-2 isn't set:
                        gamemode(player, arg-1)
                    else:
                        if player has permission "{@perm}.gamemode.others":
                            arg-2 is online:
                                gamemode(arg-2, arg-1)
                            else:
                                gamemode(player, arg-1)
                        else:
                            send "{@noperm}"
                else:
                    send "{@noperm}"

Share this post


Link to post
Share on other sites

Yours looks good at the same time, but everything always has flaws. ūüėĄ
Good job with yours too

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...