sumitnoob38

make a skript which makes it so that in the world named ffa, if a player tries to do any / command , it will not execute and instead sent a msg to the player saying that 'commands are disabled in this world', make the text bold and red, also only one command should work in that world , only the /spawn commamd

Kodari AI
KodariJun 25 at 5:27 am 5
FfaCommandBlocker
A Skript that blocks all commands in the world named "ffa", sending players a bold red message stating commands are disabled. The only exception is the /spawn command, which teleports players to the server's spawn point. Lightweight and plug-and-play — just drop into your scripts folder and reload.

How it works

Situation
Result
Player types any command in
ffa
Command cancelled + red bold message
Player types
/spawn
in
ffa
Allowed — teleports to spawn
Player types any command outside
ffa
Works normally

Setup

  1. Drop FfaCommandBlocker.sk into plugins/Skript/scripts/

  2. Run /sk reload FfaCommandBlocker

Note: The /spawn command teleports to that world’s spawn point. If you’d like it to go to a specific world’s spawn (e.g., a lobby world), let me know and I’ll update it!

Kodari can make mistakes. Review important code before using.
Files
FfaCommandBlocker.sk
Code
1 26
FfaCommandBlocker.sk
# ═══════════════════════════════════════════════
#   FFA Command Blocker
#   Blocks all commands in the "ffa" world.
#   Only /spawn is allowed.
# ═══════════════════════════════════════════════
#   INSTALL: Place in plugins/Skript/scripts/
#   RELOAD:  /sk reload FfaCommandBlocker
# ═══════════════════════════════════════════════

options:
    ffa-world: ffa
    blocked-msg: &c&lCommands are disabled in this world!

# Block all commands in the ffa world
on command:
    if world of player is "{@ffa-world}":
        if command is "/spawn":
            stop
        cancel event
        send "{@blocked-msg}" to player

# /spawn command - works in ffa world
command /spawn:
    trigger:
        teleport player to spawn of world of player
        send "&aYou have been teleported to spawn!" to player