1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved A trail skript

Discussion in 'Skript' started by emperorofwater, Nov 15, 2019.

Tags:
Thread Status:
Not open for further replies.
  1. emperorofwater

    Joined:
    Oct 28, 2019
    Messages:
    24
    Likes Received:
    0
    Old Skript
    Code (Text):
    1. command /Trailon:
    2.   permission: skript.trail
    3.   trigger:
    4.   if player doesn't have permission "skript.trailon":
    5.     make console execute command "/pex user %player% add skript.trailon"
    6.     wait 1 tick
    7.   else:
    8.     send "[&2cubedpvped&f] &6trail is on" to player
    9.   if player has permission "skript.trailon":
    10.     loop 9999:
    11.       if player has permission "skript.trailon":
    12.         make player execute command "/execute at %player% run particle minecraft:campfire_cozy_smoke ~ ~ ~ 0 0 0 0.0001 5 force"
    13.     if player has permission "skript.trailon":
    14.       send "[&2cubedpvped&f] &6trail ended" to player
    15.  
    new Skript
    Code (Text):
    1. every 10 seconds:
    2.   set {prefix.chat} to "&f[&2CubedPVPED&f]"
    3. #                        chat prefix!
    4. #                        code Made by EmperorOfWater
    5. command /Trailon:
    6.   permission: skript.trail
    7.   trigger:
    8.     if {%player%.Trail} is false:
    9.       set {%player%.Trail} to true
    10.       wait 1 tick
    11.     else:
    12.       send "%{prefix.chat}% &6trail is on" to player
    13.       stop
    14.     if {%player%.Trail} is true:
    15.       send "%{prefix.chat}% &6trail will End in 30 minutes unless you do /trailoff" to player
    16.       loop 25000 times:
    17.         if {%player%.Trail} is true:
    18.           make console execute command "/execute at %player% run particle minecraft:barrier ~ ~ ~ 0 0 0 0.0001 5 force"
    19.         wait 2 tick
    20.     if player has permission "skript.trailon":
    21.       set {%player%.Trail} to false
    22.       send "%{prefix.chat}% &6trail ended" to player
    23.       stop
    24.  
    25. command /Trailoff:
    26.   permission: skript.trail
    27.   trigger:
    28.     if {%player%.Trail} is true:
    29.       set {%player%.Trail} to false
    30.       send "%{prefix.chat}% &6trail ended" to player
    31.     else:
    32.       send "%{prefix.chat}% &6trail not on" to player
    33.       set {%player%.Trail} to false
    Notes:
    prefix = &f[&2CubedPVPED&f] & is fully Customizealbe!
    trail = barrier block
    time for full trail to complete = 30 minutes

     
    #1 emperorofwater, Nov 15, 2019
    Last edited: Nov 23, 2019
  2. Best Answer:
    Post #12 by emperorofwater, Nov 23, 2019
  3. Nutts

    Supporter

    Joined:
    Feb 9, 2019
    Messages:
    10
    Likes Received:
    0
    Please format your code in the forum post ("Insert -> Code") (The insert button is located by Picture and Media and has a plus sign in it) and paste your code in there. It will help us understand the problem.
     
    • Useful Useful x 1
  4. Govindas

    Govindas Active Member

    Joined:
    Feb 5, 2017
    Messages:
    79
    Likes Received:
    5
    well they clearly aren't correct if the script says they are incorrect, also all ifs must end with ":", remove the "if" part, keep it like this: "player has permission "x""
     
    • Like Like x 1
  5. Govindas

    Govindas Active Member

    Joined:
    Feb 5, 2017
    Messages:
    79
    Likes Received:
    5
    please include fixed code, also loop 9999: should be loop 9999 times:
     
  6. Ronnoc2w

    Ronnoc2w Member

    Joined:
    Feb 20, 2019
    Messages:
    15
    Likes Received:
    0
    Hey im soon going to be in the pc again if you want i will post the code fully functionally + i will fix some bugs i have nothing to di at the Moment so that‘s no problem :emoji_grinning:

    your error was That you mostly forgot the : after you checkt players permission
     
  7. emperorofwater

    Joined:
    Oct 28, 2019
    Messages:
    24
    Likes Received:
    0
    Yes please this will be helpful! As if you like you can join the server I'm going to run it on. IP = cubedpvped.minehut.gg and if you want I can feature you on the server BTW you can join at anytime but sometimes you will have to join on the hub because I'm running my server off a server hosted server. PS I'm on mobile and its 11:30 right now
    Good night hope to hear back soon!
     
  8. Ronnoc2w

    Ronnoc2w Member

    Joined:
    Feb 20, 2019
    Messages:
    15
    Likes Received:
    0
    Okay I will join the server im going to start with the trails Skript then.

    Do you have a teamspeak server?
    If not you can find me on: ts.skyplots.de
    Its a German teamspeak but it doesn't matter I think
     
    #7 Ronnoc2w, Nov 19, 2019
    Last edited: Nov 19, 2019
  9. emperorofwater

    Joined:
    Oct 28, 2019
    Messages:
    24
    Likes Received:
    0
    discord server not teamspeak
     
  10. Ronnoc2w

    Ronnoc2w Member

    Joined:
    Feb 20, 2019
    Messages:
    15
    Likes Received:
    0
    Well, I joined and got banned for "lol" I don't know why. My Ingame name is Ronnoc2w ?!?

    //EDIT

    Got banned on my other account what the hack?!?!??!?

    Well now the Whitelist is on and my alt accounts don't work anymore...

    Could you send me the discord link?
     
    #9 Ronnoc2w, Nov 19, 2019
    Last edited: Nov 19, 2019
  11. emperorofwater

    Joined:
    Oct 28, 2019
    Messages:
    24
    Likes Received:
    0
    Hacker was banning everyone
    fixed it
    bit.ly/discubed
     
    #10 emperorofwater, Nov 20, 2019
    Last edited: Nov 20, 2019
  12. Ronnoc2w

    Ronnoc2w Member

    Joined:
    Feb 20, 2019
    Messages:
    15
    Likes Received:
    0
    Hey ok, is the whitelist off?

    Going to join now....

    //EDIT

    Im Still banned could you unban me?
    and add me to the whitelist

    Ingame: Ronnoc2w
     
  13. emperorofwater

    Joined:
    Oct 28, 2019
    Messages:
    24
    Likes Received:
    0
    Code (Text):
    1. every 10 seconds:
    2.   set {prefix.chat} to "&f[&2CubedPVPED&f]"
    3. #                        chat prefix!
    4. #                        code Made by EmperorOfWater
    5. command /Trailon:
    6.   permission: skript.trail
    7.   trigger:
    8.     if {%player%.Trail} is false:
    9.       set {%player%.Trail} to true
    10.       wait 1 tick
    11.     else:
    12.       send "%{prefix.chat}% &6trail is on" to player
    13.       stop
    14.     if {%player%.Trail} is true:
    15.       send "%{prefix.chat}% &6trail will End in 30 minutes unless you do /trailoff" to player
    16.       loop 25000 times:
    17.         if {%player%.Trail} is true:
    18.           make console execute command "/execute at %player% run particle minecraft:barrier ~ ~ ~ 0 0 0 0.0001 5 force"
    19.         wait 2 tick
    20.     if player has permission "skript.trailon":
    21.       set {%player%.Trail} to false
    22.       send "%{prefix.chat}% &6trail ended" to player
    23.       stop
    24.  
    25. command /Trailoff:
    26.   permission: skript.trail
    27.   trigger:
    28.     if {%player%.Trail} is true:
    29.       set {%player%.Trail} to false
    30.       send "%{prefix.chat}% &6trail ended" to player
    31.     else:
    32.       send "%{prefix.chat}% &6trail not on" to player
    33.       set {%player%.Trail} to false
     
  14. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    243
    Likes Received:
    21
    Why use "loop 25000 times" it will eventually end. Just use a while statement.
    Code (Skript):
    1. while {%player%.Trail} is true:
    2.     if player is not online:
    3.         stop loop
    4.     make console execute command "etc"
    5.     wait 2 ticks
    EDIT: Didn't realize you wanted it to run for 30 minutes.
     
    #13 AsuDev, Nov 23, 2019
    Last edited: Nov 23, 2019
  15. Govindas

    Govindas Active Member

    Joined:
    Feb 5, 2017
    Messages:
    79
    Likes Received:
    5
    I recommend to not set variables to false, that does not delete them and cause permanent memory leaks, delete them instead. also I recommend variable format of {variable::%uuid of player%} or {%uuid of player%::variable}
     
  16. emperorofwater

    Joined:
    Oct 28, 2019
    Messages:
    24
    Likes Received:
    0
    you could of deleted yur post
    I also made it run out for lag reasons
    --- Double Post Merged, Nov 24, 2019, Original Post Date: Nov 24, 2019 ---
    Whats a memory leak.
    I dont know how to delete them.
    I just looked at another skript and learned off that
    I have underlined the words you used for what im speaking about
     
  17. Govindas

    Govindas Active Member

    Joined:
    Feb 5, 2017
    Messages:
    79
    Likes Received:
    5
    replace
    set {%player%.Trail} to false
    with
    delete {trail::%uuid of player%}

    memory leak is data that is kept in memory which isn't being used anymore, you are keeping every player's who has used the trail data in database, saying that their trail is false, while instead, you could just not save anything when they don't have a trail. only keep data in database which is absolute must to save, such as wins count of a player.
     
  18. emperorofwater

    Joined:
    Oct 28, 2019
    Messages:
    24
    Likes Received:
    0
    ok
    done will edit post shortly
     
Thread Status:
Not open for further replies.

Share This Page

Loading...