im dum

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

    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!

DemonGodOfEarth

New Member
Jul 20, 2023
5
0
1
I have skript code that i want to spawn lightning on a player in the argument (/electroman DemonGodOfEarth)
but im bad at skript so pls help
Code:
command /electroman <string>:
    description: Electrocutes selected player
    permission: kandl.electroman
    executable by: players
    trigger:
        spawn lightning at location of name of player in argument
        message "TEst"
 
unfortunately skript isn't magic, we will have to use specific syntax to get stuff done

you can refer to arguments by either using the argument's index (or, what number it is in the list. 1 for the first argument, 2 for the second, etc), or by using the type of the argument (in this case, string). you would then prefix that with `arg-`. for example, `arg-1` for the first argument, or `arg-string` for the string argument

with this, you can refer to any argument, including the selected player. then, with that string argument, you could get the player from the name via `arg-1 parsed as player`.
though, there's a better method. you can change the argument from `<string>` to `<player>`, and then just use `arg-player` or `arg-1` to refer to the selected player.

armed with that knowledge, you would then do `spawn lightning at arg-player`

i hope this helps c:
 
  • Like
Reactions: DemonGodOfEarth
Thank you so much! This answered my question, but i have one more. Is there a good place to find syntax and stuff for skript in like a neat organised fasinon?
 
yes! there are skunity docs & skripthub docs.


feel free to try them both to see which you like best
 
yes! there are skunity docs & skripthub docs.


feel free to try them both to see which you like best
also cool