heso_yummy

make me a script that when a player commands /discord, /dc, a message will appear in the chat that players can click and will redirct them to the website

Kodari AI
KodariMay 17 at 4:22 am 633 (v2)

I’ll create a simple Discord redirect script with clickable chat messages.

DiscordLinkScript
A lightweight Discord redirect script that provides /discord and /dc commands. When executed, players receive a clickable chat message that opens the server's Discord invite link or website. Features customizable messages, colors, and hover tooltips for an enhanced user experience. Easy to configure through options section.

[Generation stopped]

Kodari can make mistakes. Review important code before using.
Files
discord-link.sk
README.txt
Code
2 65
discord-link.sk
# Discord Link Script
# Author: Generated
# Version: 1.0
# Description: Provides clickable Discord link commands

options:
    # Configure your Discord invite link or website URL
    discord-url: https://discord.gg/yourserver
    
    # Customize the messages (use & for color codes)
    prefix: &6[Discord]&r
    main-message: &7Join our Discord server!
    clickable-text: &b&nClick Here to Join
    hover-text: &eClick to open Discord invite!
    
    # Border decoration (optional)
    border: &7&m―――――――――――――――――――

on script load:
    send "{@prefix} Discord Link Script v1.0 loaded!" to console

# Main /discord command
command /discord:
    aliases: /dc
    trigger:
        send "" to player
        send "{@border}" to player
        send "" to player
        send "  {@prefix} {@main-message}" to player
        send "" to player
        send "  {@clickable-text}" to player
        send "" to player
        send "{@border}" to player
        
        # Make the clickable text open the URL
        execute player command "/discordlink"

# Hidden command that handles the clickable link
command /discordlink:
    trigger:
        # This creates a clickable JSON text component
        send "&7Join our Discord server!" to player
        send formatted text "&b&n[Click Here to Join Discord]" with hover "{@hover-text}" with click action to open url "{@discord-url}" to player