Skript

Forum > Help

Can't login + Server "null"

  • 11 posts
    #1 Dec 23, 2013 at 01:12 UTC - 0 likes

    I get no errors, but when the script is loaded, I can not login to the server, and the server console "freezes", meaning that any command I type, including stop, does not go through to the server.

    Here is the entire script

    Thank you to @MostFunGuy for helping me fix part of the script :D

    Last edited Dec 23, 2013 by mcredstonepro
    #2 Dec 23, 2013 at 01:30 UTC - 1 like

    @mcredstonepro: Go

    Thats because its running your "while" loop literally FOREVER with no delay. Add a:

    wait 2 ticks
    

    So that it doesnt continuously run with no delay

    MostFunGuy:

    Owner of the Off The Grid Network - MCOTG.COM

    #3 Dec 23, 2013 at 01:40 UTC - 0 likes

    Ok that fixed the null and cant login part, but I still am having trouble with the script

    Players can sneak for a second, and then they will get the effects after 5 seconds, even if they are not still sneaking

    on join:
    	wait 2 ticks
    	while player is online:
    		while player is sneaking:
    			if {KitPvP.%player%.UsingKit} is "Assassin":
    				wait 1 second
    				send "&a20% Charged" to player
    				wait 1 second
    				send "&a40% Charged" to player
    				wait 1 second
    				send "&a60% Charged" to player
    				wait 1 second
    				send "&a80% Charged" to player
    				wait 1 second
    				send "" to player
    				send "&a100% Charged" to player
    				send "" to player
    				send "&8 - &cApplied: &aStrength, Swiftness, and Invisibility &9for 5 seconds" to player
    				send "" to player
    				apply potion of strength of tier 2 to the player for 5 seconds
    				apply potion of swiftness of tier 2 to the player for 5 seconds
    				apply potion of invisibility of tier 2 to the player for 5 seconds
    			else:
    				stop
    
    #4 Dec 23, 2013 at 02:46 UTC - 1 like

    Because it only have to trigger the thing by sneaking, it has now checks along the way.

    while the player is sneaking:
      loop 5 times:
        if the player is not sneaking:
          stop
        message "%loop-num * 2%0 percent charged" to player
        wait 1 second
        if loop-num is 5:
          apply potion of strength of tier 2 to the player for 5 seconds
          apply potion of swiftness of tier 2 to the player for 5 seconds
          apply potion of invisibility of tier 2 to the player for 5 seconds
    
    Last edited Dec 23, 2013 by MostFunGuy
    #5 Dec 23, 2013 at 03:28 UTC - 0 likes
    Quote from MostFunGuy: Go

    Because it only have to trigger the thing by sneaking, it has now checks along the way.

    while the player is sneaking:
      loop 5 times:
        if the player is not sneaking:
          stop
        message "%loop-num * 2%0 percent charged" to player
        wait 1 second
        if loop-num is 5:
          apply potion of strength of tier 2 to the player for 5 seconds
          apply potion of swiftness of tier 2 to the player for 5 seconds
          apply potion of invisibility of tier 2 to the player for 5 seconds
    

    Thank you, I will try it. Sorry for asking for so much help lately, though I have been using Skript for a while, I still don't understand a lot of the events, expressions and such. So thank you for all the help you have given to me :D

    #6 Dec 23, 2013 at 03:49 UTC - 0 likes

    @mcredstonepro: Go

    I try to help as much as i can.

    #7 Dec 23, 2013 at 05:55 UTC - 0 likes
    Quote from MostFunGuy: Go

    @mcredstonepro: Go

    I try to help as much as i can.

    Tested what you told me to do, and I got the can't login and server nulling thingy again

    This is the error I get to console: "There's no loop that matches 'loop-num'"

    on join:
    	wait 2 ticks
    	while player is online:
    		while the player is sneaking:
    			if {KitPvP.%player%.UsingKit} is "Assassin":
    				loop 5 times:
    					if the player is not sneaking:
    						stop
    				message "%loop-num * 2%0 percent charged" to player
    				wait 1 second
    				if loop-num is 5:
    					send "&a100% Charged" to player					
    					send "" to player
    					send "&8 - &cApplied: &aStrength, Swiftness, and Invisibility &9for 5 seconds" to player
    					send "" to player
    					apply potion of strength of tier 2 to the player for 5 seconds
    					apply potion of swiftness of tier 2 to the player for 5 seconds
    					apply potion of invisibility of tier 2 to the player for 5 seconds
    			else:
    				stop
    
    Last edited Dec 23, 2013 by mcredstonepro
    #8 Dec 23, 2013 at 06:10 UTC - 0 likes

    @mcredstonepro: Go

    on join:
    	while player is online:
    		if player is sneaking:
    			if {KitPvP.%player%.UsingKit} is "Assassin":
    				loop 5 times:
    					message "%loop-number * 2%0 percent charged" to player
    					if player is not sneaking:
    						exit loop
    					if loop-number is 5:
    						send "&a100% Charged" to player					
    						send "" to player
    						send "&8 - &cApplied: &aStrength, Swiftness, and Invisibility &9for 5 seconds" to player
    						send "" to player
    						apply potion of strength of tier 2 to the player for 5 seconds
    						apply potion of swiftness of tier 2 to the player for 5 seconds
    						apply potion of invisibility of tier 2 to the player for 5 seconds
    					wait 1 second
    		wait 1 tick
    

    I cleaned up the code for you. (untested)

    Inferred intentions:

    • You did not want to use a while loop to check if the player is sneaking, simplified to if
    • You did not want to exit the trigger, fixed to exit loop

    <a href="#" style="display: none;">This text should not be visible at any cost</a>

    #9 Dec 23, 2013 at 06:20 UTC - 0 likes

    @destroyer4017: Go

    Ok I don't get the crashing thing, but now, if a player sneaks, they can stop sneaking and still get 20%. Then they can sneak again for a sec or so and get to 40%. They can do this to 100%. I need it where only if they sneak for 5 seconds, they get the boost, not if they sneak once, then sneak again and again 5 times.

    Not sure if this makes sense to you, I am not sure how to go abouts explaining this

    If you want to come on my server so I can show you, join 76.168.118.211

    Last edited Dec 23, 2013 by mcredstonepro
    #10 Dec 23, 2013 at 06:52 UTC - 0 likes

    @mcredstonepro: Go

    Why not use the on sneak event instead?

    #11 Dec 23, 2013 at 07:11 UTC - 0 likes
    Quote from MostFunGuy: Go

    @mcredstonepro: Go

    Why not use the on sneak event instead?

    I could try that

    Edit: I made it finally, and working exactly how I want it to work :D

    Thank you @MostFunGuy and @destroyer4017 for helping me :D

    Last edited Dec 23, 2013 by mcredstonepro
  • 11 posts

You must login to post a comment. Don't have an account? Register to get one!