Name of loop player

  • 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 comminuty!

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

DanRub

Active Member
Jun 3, 2023
155
12
18
23
Hi, is possible, that i would use full loop players name in skript? Im creating skript for mention in chat, but i have problem that if someone name is "DanRub" and other one is "DanRub2" and you write "hi DanRub2" it pings both DanRub and DanRub2 in that message, but i need to ping only "DanRub2" bc i want say hi only to "DanRub2"I need something like this, but idk how exactly.. some help? (I already tried like if message matches loop-player's name AND it actually does what i want, but it pings only in clear message, so only "DanRub2" and wouldnt ping "DanRub2 hi!" you know)
Code:
on chat:
    loop all players:
        if message contains full name of loop-player:
 
Okay so first of all, I do not recommend looping all players. It WILL cause much lag, like very much.

I recommend getting list of online players. There are many possible ways of doing that.
Easiest one is adding player to list when they join and removing them when they leave and when skript starts, reset entire list.

Now lets get to your problem.
I do not think that it is possible but there are workarounds you can try.
For example checking how many matches it gets, narrowing them down to the best one. This one is pretty complicated to do and requires a lot of testing.

But if you got the list of active players, you can use that list. You need to check if message contains any value from that list.

Not sure if any of those work, but they should. Haven't tested.
 
Okay so first of all, I do not recommend looping all players. It WILL cause much lag, like very much.

I recommend getting list of online players. There are many possible ways of doing that.
Easiest one is adding player to list when they join and removing them when they leave and when skript starts, reset entire list.

Now lets get to your problem.
I do not think that it is possible but there are workarounds you can try.
For example checking how many matches it gets, narrowing them down to the best one. This one is pretty complicated to do and requires a lot of testing.

But if you got the list of active players, you can use that list. You need to check if message contains any value from that list.

Not sure if any of those work, but they should. Haven't tested.
Uh. think i will pass that, im not that skilled in skript :emoji_grinning: