executing commands with variables

  • 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 our Wiki for downloads and any other information about Skript!

Status
Not open for further replies.
May 27, 2021
3
0
1
35
I am trying to create a snowball that on impact creates a cloud, I have made the cloud using a datapack function and this is the code:
Code:
on projectile hit:
    projectile is a snowball
    set {_block} to the block at location of the projectile
    loop 5000 times:
        execute the command "execute positioned {_block} run function sp:particles" by console
        wait 0.05 seconds
This is supposed to last for 5 seconds but I cant use console commands with variables for some reason
 
if you type "
Code:
execute positioned {_block} run function sp:particles
" in your server's console, what happens?\

, if you want to parse the variable of {block} you need to add %% around it. otherwise it literally tries to 'type' out {_block} in the console.

so try:
Code:
execute the command "execute positioned %{_block}% run function sp:particles" by console


ALSO, 5000x 0,05s = 250s or just over 4 minutes.
you want to loop your effect 100 times not 5000 times.
 
Last edited:
Status
Not open for further replies.