Help with placeholders

  • 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.
Feb 10, 2021
18
0
1
22
Skript Version: 2.5.3
Skript Author: Bensku
Minecraft Version: 1.16.4
---
Full Code:

Code (Skript):

set {_prefix} to placeholder "player_level" # placeholder "%%player_level%%" is also valid

command /skills:
trigger:
set {_gui} to a new chest inventory with 6 row with name "&c&lSkills"
set slot 13 of {_gui} to red stained glass pane named "&7&l%%player%%" with lore "%{_prefix}%"
open {_gui} to player

on inventory click:
if name of event-inventory is "&c&lSkills":
if index of event-slot = 13:
cancel event
send "%{_prefix}%"

Errors on Reload:

Code (Skript):

invalid line - all code has to be put into triggers (skills.sk, line 1: set {_prefix} to placeholder "player_level"# placerholder "%%player_level%%" is also valid')

Console Errors: (if applicable)

Code (Skript):

  1. got no console error

Other Useful Info:

Addons using (including versions):
ersatz

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? No
What other methods have you tried to fix it? I have tried to google it but nothing showed anything helpful
 
Skript already told you - you can't just have a single command, there must be a trigger = event / command / ...
You may use "on load" event:
Code:
on load:
    set variable to your placeholder
[doublepost=1612962534,1612961928][/doublepost]oops! almost forgot... you can't set a variable starting with _ in there.- i would suggest to put it right into the "on inventory click event":
Code:
on inventory click:
    name of event-inventory is "&c&lSkills"
    index of event-slot = 13
    cancel event
    set {_prefix} to placeholder "player_level" from player
    send "%{_prefix}%"
 
sorry im new to scripting so i just needed some help
[doublepost=1613001043,1613000488][/doublepost]Darn it i tryed what u say but i just cant figure it out. Im so bad at life lol. This is asking for alot but could u just msg me the skript that would work. Really sorry but i started scripting last week. )=
 
Status
Not open for further replies.