while player is online:
if player is in world "serverspawn":
wait 8 ticks
set title of player's board to "&8&l[&b&lDiamondCent&8&l]"
set line 1 of player's board to "&7Players online &8[&f%amount of all players%&8]"
set line 2 of player's scoreboard to " "
set line 3 of player's scoreboard to "DiamondGems: %{diamondgems::%player%}%" # or any other currency, if theres coins im doing diamondgemms
set line 4 of player's scoreboard to "Wins: %{wins::%player%}%"
set line 5 of player's scoreboard to " "
set line 6 of player's scoreboard to "&bDiamondCent.minehut.gg"
else if player is in world "Schmiede":
wait 8 ticks
toggle player's board off
clear player's board```
The server crashes everytime it goes to the world Schmiede or any other world besides serverspawn.
Crash Logs:
#Why does this scoreboard crash my server?
1 messages · Page 1 of 1 (latest)
if the player is not in the world "serverspawn", it's not going to wait
therefore the while loop will crash
^
i always put the wait immediately after the while loop so i know i dont forget it or make it not run
I put wait 8 ticks
yes
but its inside a condition
if that condition doesnt pass it wont wait
oh, you put it in both conditions, i see what you mean
still you can pull it out and only wait once
if the player's world is not "serverspawn" or "Schmiede", it will not wait
also yeah its better to put shared code outside of conditions
if name of event-inventory = "SHOP":
cancel event
# etc
else if name of event-inventory = "SHOP 2":
cancel event
# etc```
->
```on inventory click:
cancel event
if name of event-inventory = "SHOP":
# etc
else if name of event-inventory = "SHOP 2":
# etc```
makes it easier to read
less code to write
overall just a nicer experience
wait 8 ticks
while player is online:
if player is in world "serverspawn":
set title of player's board to "&8&l[&b&lDiamondCent&8&l]"
set line 1 of player's board to "&7Players online &8[&f%amount of all players%&8]"
set line 2 of player's scoreboard to " "
set line 3 of player's scoreboard to "DiamondGems: %{diamondgems::%player%}%" # or any other currency, if theres coins im doing diamondgemms
set line 4 of player's scoreboard to "Wins: %{wins::%player%}%"
set line 5 of player's scoreboard to " "
set line 6 of player's scoreboard to "&bDiamondCent.minehut.gg"
else if player is in world "Schmiede":
toggle player's board off
clear player's board```
so like this?
That seems like what we suggested
One problem, wouldnt that crash the server when it starts. Since on a while loop, the skript will keep repeating and the wait 8 ticks will just start it when the player joins.
so the wait 8 ticks will only happen once basically
while player is online:
if player is in world "serverspawn":
set title of player's board to "&8&l[&b&lDiamondCent&8&l]"
set line 1 of player's board to "&7Players online &8[&f%amount of all players%&8]"
set line 2 of player's scoreboard to " "
set line 3 of player's scoreboard to "DiamondGems: %{diamondgems::%player%}%" # or any other currency, if theres coins im doing diamondgemms
set line 4 of player's scoreboard to "Wins: %{wins::%player%}%"
set line 5 of player's scoreboard to " "
set line 6 of player's scoreboard to "&bDiamondCent.minehut.gg"
else if player is in world "Schmiede":
toggle player's board off
clear player's board
wait 8 ticks```
Making sure one last time
THIS CODE will work right?
Your wait is not inside the while loop
Yes, but when it's inside both while loops the "Schmiede" world crashes
it's not in either while loop
you just have it wait for nothing, actually it can't even be reached
@topaz portal This is what the skript actually is
you say it crashes the world?
Yes, I put the crash text in the post.
and to be more specific, the serverspawn world doesn't crash the world but when your in Schmiede then the world crashes.
Why are both toggling and clearing the scoreboard?
Well I thought that would stop it since the original didn't have it before.
I don't think it's necessary to toggle it off and clear it
try like
on join:
while player is online:
wait 8 ticks
# the rest of your code```
and try removing `clear player's scoreboard`
I can't be certain that'll fix it completely but I'm just tryna simplify your code
k
…
One of the first suggestions