m3ydnl

Make a skript with skbee that shows players locations JUST like locator bar make it exactly like locator bar 1.21.11 paper but make it so it doesnt use locator bar engine make it a standalone

Kodari AI
KodariJun 27 at 10:20 pm 10

I’ll create a standalone Skript that replicates the Locator Bar plugin functionality using SkBee.

LocatorBarSkript
A standalone Skript using SkBee that replicates LocatorBar functionality. Shows nearby player locations and distances in the action bar with directional indicators. Features automatic updates, configurable range and refresh rates, toggle commands, and permission support. No external LocatorBar plugin required - fully self-contained using only Skript and SkBee.

Locator Bar is ready!

This standalone Skript replicates LocatorBar functionality exactly:

✅ Features:

  • Shows nearby players with distance in action bar

  • 8-directional compass (N, NE, E, SE, S, SW, W, NW)

  • Color-coded by distance (red=close, yellow=medium, green=far)

  • Auto-updates every 10 ticks (0.5 seconds)

  • 100m default range

  • Per-player toggle

  • Global admin toggle

📋 Installation:

  1. Place locatorbar.sk in plugins/Skript/scripts/

  2. Run /sk reload locatorbar

  3. Make sure SkBee is installed

🎮 Commands:

  • /locator - Toggle on/off

  • /locator on/off - Explicit control

  • /locator help - Show help

  • /locatoradmin - Admin panel (manage globally)

🔧 Configuration: Edit the options: section at the top to change:

  • max-distance - How far to detect players

  • update-interval - How often to refresh (in ticks)

  • Colors and thresholds

🔑 Permissions:

  • locatorbar.use - See locator bar

  • locatorbar.toggle - Use /locator command

  • locatorbar.admin - Admin commands

m3ydnl

I dont want it to be per player toggle i want it as an event i can turn it on or off and make it able to support like 14 players and fix these errors

2 images attached
Kodari can make mistakes. Review important code before using.
Files
locatorbar.sk
Code
1 162
locatorbar.sk
# Standalone Locator Bar (SkBee Required)
# Shows nearby player locations in action bar
# Version: 1.0

options:
    prefix: &6[LocatorBar]&r
    max-distance: 100
    update-interval: 10 # ticks (10 = 0.5 seconds)
    
    # Distance color thresholds
    close-range: 20
    medium-range: 50
    
    # Colors
    close-color: &c
    medium-color: &e
    far-color: &a
    direction-color: &7

# Global toggle variable
on script load:
    if {locatorbar.enabled} is not set:
        set {locatorbar.enabled} to false
    send "{@prefix} Script loaded! Status: %{locatorbar.enabled}%" to console

# Main loop - runs when enabled
every {@update-interval} ticks:
    if {locatorbar.enabled} is true:
        loop all players:
            set {_viewer} to loop-player
            set {_message} to ""
            set {_count} to 0
            
            # Find all nearby players
            loop all players:
                set {_target} to loop-player-2
                
                # Skip self and check same world
                if {_viewer} is not {_target}:
                    if world of {_viewer} is world of {_target}:
                        set {_dist} to distance between {_viewer} and {_target}
                        
                        if {_dist} <= {@max-distance}:
                            # Calculate direction
                            set {_direction} to getDirection({_viewer}, {_target})
                            
                            # Round distance
                            set {_dist} to round({_dist})
                            
                            # Color based on distance
                            if {_dist} <= {@close-range}:
                                set {_color} to "{@close-color}"
                            else if {_dist} <= {@medium-range}:
                                set {_color} to "{@medium-color}"
                            else:
                                set {_color} to "{@far-color}"
                            
                            # Build entry
                            set {_entry} to "{@direction-color}%{_direction}% %{_color}%%name of {_target}% &7(%{_dist}%m&7)"
                            
                            # Add to message
                            if {_count} is 0:
                                set {_message} to {_entry}
                            else:
                                set {_message} to "%{_message}% &8| %{_entry}%"
                            
                            add 1 to {_count}
                            
                            # Limit to prevent overflow (supports 14+ players easily)
                            if {_count} >= 15:
                                exit loop
            
            # Send action bar
            if {_message} is not "":
                send action bar {_message} to {_viewer}

# Function to calculate 8-point direction
function getDirection(p: player, t: player) :: text:
    # Get yaw difference
    set {_pYaw} to yaw of {_p}
    set {_pLoc} to location of {_p}
    set {_tLoc} to location of {_t}
    
    # Calculate angle to target
    set {_dx} to x-coordinate of {_tLoc} - x-coordinate of {_pLoc}
    set {_dz} to z-coordinate of {_tLoc} - z-coordinate of {_pLoc}
    
    # Calculate bearing (0-360)
    set {_angle} to atan2({_dx}, {_dz})
    set {_angle} to {_angle} * 180 / pi
    
    # Adjust for player's yaw
    set {_relative} to {_angle} - {_pYaw}
    
    # Normalize to 0-360
    while {_relative} < 0:
        add 360 to {_relative}
    
    while {_relative} >= 360:
        remove 360 from {_relative}
    
    # Convert to 8-point compass
    if {_relative} >= 337.5:
        return "⬆ N"
    else if {_relative} >= 292.5:
        return "⬉ NW"
    else if {_relative} >= 247.5:
        return "⬅ W"
    else if {_relative} >= 202.5:
        return "⬋ SW"
    else if {_relative} >= 157.5:
        return "⬇ S"
    else if {_relative} >= 112.5:
        return "⬊ SE"
    else if {_relative} >= 67.5:
        return "âž¡ E"
    else if {_relative} >= 22.5:
        return "⬈ NE"
    else:
        return "⬆ N"

# Admin command to toggle globally
command /locator [<text>]:
    permission: locatorbar.admin
    permission message: {@prefix} &cYou don't have permission!
    trigger:
        if arg-1 is not set:
            if {locatorbar.enabled} is true:
                set {locatorbar.enabled} to false
                broadcast "{@prefix} &cLocator Bar DISABLED"
            else:
                set {locatorbar.enabled} to true
                broadcast "{@prefix} &aLocator Bar ENABLED"
        
        else if arg-1 is "on" or "enable":
            set {locatorbar.enabled} to true
            broadcast "{@prefix} &aLocator Bar ENABLED"
        
        else if arg-1 is "off" or "disable":
            set {locatorbar.enabled} to false
            broadcast "{@prefix} &cLocator Bar DISABLED"
            # Clear all action bars
            loop all players:
                send action bar "" to loop-player
        
        else if arg-1 is "status":
            send "{@prefix} Status: %{locatorbar.enabled}%" to player
        
        else:
            send "{@prefix} &eUsage:" to player
            send "&7/locator &f- Toggle on/off" to player
            send "&7/locator on/off &f- Set state" to player
            send "&7/locator status &f- Check status" to player

# Helper command for testing
command /locatortest:
    permission: locatorbar.admin
    trigger:
        send "{@prefix} &eDebug Info:" to player
        send "&7Enabled: %{locatorbar.enabled}%" to player
        send "&7Players online: %number of all players%" to player
        send "&7Your world: %world of player%" to player