Skript Version: 2.6.4
Minecraft Version: 1.19.3
This is my 5th day learning Skript, and I've run across a problem... If you sprint for a certain duration of time while not flying, you gain tiredness. It slowly goes away as you avoid sprinting. However, for some reason no matter what I am always slow. I reused part of the code for something else I made that worked fine, so I am completely lost here.
Any help would be appreciated.
Minecraft Version: 1.19.3
This is my 5th day learning Skript, and I've run across a problem... If you sprint for a certain duration of time while not flying, you gain tiredness. It slowly goes away as you avoid sprinting. However, for some reason no matter what I am always slow. I reused part of the code for something else I made that worked fine, so I am completely lost here.
Any help would be appreciated.
Code:
on every tick:
loop all players:
set {_uuid} to uuid of loop-player
if loop-player is sprinting:
# Reverts/ignores tiredness if the player is flying
if loop-player is flying:
if {-tiredness.%uuid of loop-player%} > 0:
remove 1 from {-tiredness.%uuid of loop-player%}
# Makes the player slowly become tired if they are not flying
else if {-tiredness.%uuid of loop-player%} <= 500:
add 1 to {-tiredness.%uuid of loop-player%}
# Takes away tiredness when the player is not sprinting
else if {-tiredness.%uuid of loop-player%} > 0:
remove 1 from {-tiredness.%uuid of loop-player%}
# Determines effects on players based on tiredness levels
# Not tired
if {-tiredness.%uuid of loop-player%} < 200:
reset walk speed of loop-player
# Tired
else:
set loop-player's walk speed to 0.15