Skript How to make a simple proximity chat system with loop-value

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

PixelCraft_I_D_K

Active Member
Jul 18, 2023
66
1
8
Hello! This is a simple Skript tutorial on how to create a Skript proximity chat system.

How it works: It will tell the player how many people heard them and it will send the player's message to everyone within a 12 (configurable) block radius.

Skript Template:


Code:
on chat:
    loop all players within 10 blocks of player:
        cancel event
        send "&7[PC] &f<%player%> %message%" to loop-player
        set {yes::%player's uuid%::*} to loop-player
        set {var::%player's uuid%} to amount of {yes::%player's uuid%::*}
        remove 1 from {var::%player's uuid%}
        send action bar "&f%{var::%player's uuid%}% people heard you" to player


How to configure:

"loop all players within 10 blocks of player:" - You can change "10" to any block radius you want.

"send "&7[PC] &f<%player%> %message%" to loop-player" - You can change this format any way you want, just note that "%message%" is the player's message and "%player%" is the player.

"remove 1 from {var::%player's uuid%}" - It's not recommended to change this, but removing this would say "1 people heard you" instead of "0 people heard you". This removes the player from the loop-value.


Please credit me!