#Hey so im making a join / leave message but it wont work

1 messages · Page 1 of 1 (latest)

olive kraken
#

it needs to be put into a trigger

#

!skript

modern hearthBOT
# olive kraken !skript

📑 Skript Documentation

Skript documentation, sometimes referred to as "the docs" are a great resource for beginners learning skript or experts reviewing a topic. They hold a wide variety of information on various events, conditions, effects, and expressions. Here’s a few popular documentation websites:

The skUnity Parser is a great tool which can parse (run) your skript code in a web browser and check for errors!

mortal bridge
#

read the error

worthy tartan
#

YEs

#

But what is triggers

mortal bridge
#

google

worthy tartan
#

I tried

#

Wont help

olive kraken
#
   send "test"```
kind blaze
#
on join:
    i already give you the trigger```
worthy tartan
#

Like that?

olive kraken
#

!indention

kind blaze
#

!indentsn

olive kraken
#

!tab

mortal bridge
#

tab

kind blaze
#

!inderntat

#

!inrtend

olive kraken
#

!indenation

kind blaze
#

!indention

#

what

#

!indent

modern hearthBOT
# kind blaze !indent

In skript, you need to maintain consistent indentation, meaning you cannot indent 1 line 5 spaces, and the next 7 spaces. Usually it’s recommended you use tabs, however.

A good rule of thumb is to always indent the subsequent line whenever the previous statement ends with a :, an exception to this is in command statements with items before the trigger such as permission: or aliases:

With conditional statements and loops, any code that is indented within the statement will be run as a part of the statement, other code will not be run within the statement. Here is an example of proper indentation:

https://i.imgur.com/PbfZ12M.png

kind blaze
#

there you go

olive kraken
#

oh it's !in dent

#

ic

worthy tartan
#

Idk waht it says

#

Im not a scripter realy

olive kraken
#

Read it

worthy tartan
#

Yes I get it but why wont my script work then?

olive kraken
#

read it

#

and you'll see the issue

mortal bridge
# worthy tartan

go to beggining of line 2 and 5 and press tab or it cant read it

worthy tartan
worthy tartan
#

on join set join message to ...

olive kraken
#

Nope

worthy tartan
#

oh

olive kraken
#

You need tabs or spaces to signify the next line

worthy tartan
#

oh

#

Java is dumb

olive kraken
#

Read the paragraph that starts with - A good rule of thumb

olive kraken
worthy tartan
#

Isent it?

kind blaze
#

it's not java

worthy tartan
#

Is this good

#

on join:
set join message to "&a%player% Joined the server!"

on quit:
set quit message to "&c%player% Left the server!"

kind blaze
#

that's alright

#

i guess

worthy tartan
#

Ok

mortal bridge
#

yes

worthy tartan
#

Let me check

olive kraken
#

or do Shrug

worthy tartan
#

lol

#

It works now thanks for the help!

kind blaze
#

in java it would be

#
    @EventHandler
    public void JoinEvent(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        event.setJoinMessage("§7(§2§l+§7)§a" + player.getName() + " joined the lobby.");
    }
worthy tartan
#

Nahhh

#

Tooooo hard

kind blaze
#

what this code does is send message when player join

#

and also send a title with hex color

#

which you have to manually implement yourself or get an api to do it

worthy tartan
#

lol

kind blaze
#

in my case i made my owjn

#
    public String translateHexColorCodes(String message) {
        Pattern hexPattern = Pattern.compile("&#([A-Fa-f0-9]{6})");
        Matcher matcher = hexPattern.matcher(message);
        StringBuffer buffer = new StringBuffer();
        while (matcher.find()) {
            String hexCode = matcher.group(1);
            StringBuilder replacement = new StringBuilder("§x");
            for (char c : hexCode.toCharArray()) {
                replacement.append('§').append(c);
            }
            matcher.appendReplacement(buffer, replacement.toString());
        }
        matcher.appendTail(buffer);
        return buffer.toString();
    }
``` smth like this
worthy tartan
#

thx for the help tho

mortal bridge
olive kraken
#

🖐️

deft tundra
#

why the are you posting java here, i thought this is skript related 💀

kind blaze
#

And I show him java and how hard is it

deft tundra
#

still bro, don't post java here, you could get muted for posting unrelated stuff to a channel