How do I make an infinite loop in skript because whenever I try to do something periodically like "every second" it gives me an error.
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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
command /ksmenu13:
trigger:
if {team.%player%} is equal to "Red":
if {corejump.progress.redteam} >= 20:
message "&7Core Jump Buff Already Purchased."
else if {kill_streak.%player%.count} >= 1:
add 1 to {corejump.progress.redteam}
set {kill_streak.%player%.count} to {kill_streak.%player%.count} - 1
message "&7Added to Core Jump Buff total."
if {corejump.progress.redteam} is equal to 20:
set {corejump.redteam} to 1
every second
if {corejump.redteam} is equal to 0:
stop loop
add 1 to {loop.count}
wait 1 second
broadcast "test"
every 1 seconds in "world":
if {corejump.redteam} is equal to 0:
stop loop
every second in radius 8 of {redcore}:
# do stuff
command /ksmenu13:
trigger:
if {team.%player%} is equal to "Red":
if {corejump.progress.redteam} >= 20:
message "&7Core Jump Buff Already Purchased."
else if {kill_streak.%player%.count} >= 1:
add 1 to {corejump.progress.redteam}
set {kill_streak.%player%.count} to {kill_streak.%player%.count} - 1
message "&7Added to Core Jump Buff total."
if {corejump.progress.redteam} is equal to 20:
set {corejump.redteam} to 1
every second in radius 8 of {redcore}:
if {corejump.redteam} is equal to 0:
stop loop
wait 1 second
apply jump boost to loop-player for 1 second
maybe try it like this? I just tried testing a bunch of possible sytaxes to loop at a set of coords, but no dice.Ok, thanks sorry I didn't realize that can you loop all worlds or all players around a location? Like I have a variable set at a location I want to loop every second
[doublepost=1501385224,1501384659][/doublepost]code_language.skript:every second in radius 8 of {redcore}: # do stuff
Like that?
How would I make it loop players
[doublepost=1501385802][/doublepost]It's not working
code_language.skript:command /ksmenu13: trigger: if {team.%player%} is equal to "Red": if {corejump.progress.redteam} >= 20: message "&7Core Jump Buff Already Purchased." else if {kill_streak.%player%.count} >= 1: add 1 to {corejump.progress.redteam} set {kill_streak.%player%.count} to {kill_streak.%player%.count} - 1 message "&7Added to Core Jump Buff total." if {corejump.progress.redteam} is equal to 20: set {corejump.redteam} to 1 every second in radius 8 of {redcore}: if {corejump.redteam} is equal to 0: stop loop wait 1 second apply jump boost to loop-player for 1 second
https://gyazo.com/afdfe1f5cff760b71b8a83b88b67c52d
#This is just the test code I used, but it works for checking a player's proximity to a location
command /test:
trigger:
set {loc} to location of player
send "%{loc}%"
command /loop:
trigger:
loop all players:
if distance between loop-player and {loc} is smaller than 20:
send "Moo"
command /ksmenu13:
trigger:
if {team.%player%} is equal to "Red":
if {corejump.progress.redteam} >= 20:
message "&7Core Jump Buff Already Purchased."
else if {kill_streak.%player%.count} >= 1:
add 1 to {corejump.progress.redteam}
set {kill_streak.%player%.count} to {kill_streak.%player%.count} - 1
message "&7Added to Core Jump Buff total."
if {corejump.progress.redteam} is equal to 20:
set {corejump.redteam} to 1
every 1 seconds in "GameWorld":
loop all players in "GameWorld":
if distance between loop-player and {redcore} is smaller than 9:
apply jump boost to loop-player for 1 second
What do you mean by object? :0How does object work, and can you make a while loop with that, that can loop forever
That is really vague yikes. I don't think it matters what you want to loop, "object" seems to implicate anything. So pretty much loop list of something while a condition is met. So something like this maybeThe documentation is really vague
https://gyazo.com/b332f5413a851a5bb213fbaba84f4a96
https://gyazo.com/52bef49430f8d012cc27b38bcc7fbbfc
loop all player's while {variable} is true:
every 1 seconds in "GameWorld":
loop all players in "GameWorld":
if distance between loop-player and {redcore} is smaller than 9:
apply jump boost to loop-player for 1 second
while 1 is 1:
loop all players in "GameWorld":
if distance between loop-player and {redcore} is smaller than 9:
apply jump boost to loop-player for 1 second
wait 1 second