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

Status
Not open for further replies.

CustomWorldYT

Member
Jun 17, 2018
15
0
0
I'm developing Skript, and I want a command to edit messages of plugin in-game, because not every person is friend with Skript's options. I'm using variables to save pieces of messages, that can be edited in-game using command "/edit prefix &a&lNew Prefix &b&l>>" (for example). But now, I want to make messages compatible with placeholders like %arg 1%, %player%, etc. Every time I use "/edit mutemsg &c%player% &eis muted." (for another example), it will just show %player% in the chat, not player name.

Skript Version:2.2 (dev. 36)
Skript Author: CustomWorldYT (Me)
Minecraft Version: 1.12.2

---
Code:

code_language.skript:
set {cw.lang::muted} to "&cPlayer &e[B]%player% [/B]&cis muted." #How to put placeholders into variables to use it with message effects?
message "%{cw.lang::muted}%" to player #If staff will use "/edit mutemsg &e%player% &cis muted." for example, it will just show "%player%" in the chat, not player name.

Errors on Reload:

code_language.skript:
None, it will just show %player% in the chat. However, if I want to create variable on Skript start containing placeholder, it will show me %player% cannot be used in "on skript start" event, or similar message.

Console Errors: (none)

code_language.skript:
None...

Other Useful Info:

Addons using (including versions):
No addons currently.

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it?
I tired to double the percents (%%player%%), but it didn't helped and it showed "%%player%%" again.
 
Try using placeholder-placeholders:
Example command:
code_language.skript:
/set msg-1 &cTest {player}
Code (not tested though)
code_language.skript:
set {var} to "&cTest {player}"

command /test:
    trigger:
        set {_lang::*} to "%{var}%"
        replace all "{player}" with "%player%" in {_lang::*}
        send "%{_lang::*}%"
 
Status
Not open for further replies.