-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Blogs
Events
Store
Downloads
Posts posted by l1j
-
-
Description
I'm fairly new to skript, and I've created a command that tells the player how much more of an item they need out of 64
Steps to Reproduce
Once the command is run, it'll say "An internal error occurred while attempting to perform this command." to my player, here's the code:
options:
amount: 64command /antimatter:
trigger:
set {_am} to amount of sweet berries named " &4&ki &cAnti-matter berries &4&ki" with lore "&3Trade for anti-matter gens" and " &9&l&kii &6/antimatter &9&l&kii" in player's inventory
if player has 64 sweet berries named " &4&ki &cAnti-matter berries &4&ki" with lore "&3Trade for anti-matter gens" and " &9&l&kii &6/antimatter &9&l&kii":
remove 64 of sweet berries named " &4&ki &cAnti-matter berries &4&ki" with lore "&3Trade for anti-matter gens" and " &9&l&kii &6/antimatter &9&l&kii" from player
give player 1 light gray glazed terracotta named "&b&ki &f&lAnti-Matter Generator &b&ki" with lore "&4Resets every 10 seconds!"
send "&b&lOculis &8&l» &f&lAnti-Matter &3generator received!"
else:
set {_needed} to {@amount} - {_am}
send "&b&lOculis &8&l» &3You need %{_needed}% more"Expected Behavior
It should send a message to the player that reads "&b&lOculis &8&l» &3You need (64 - however many more you need) more" but, as stated before it says An internal error occurred while attempting to perform this command." instead.
Errors / Screenshots
Here's the gist link to the error:
https://gist.github.com/SmellyEggplant/e4382b0a8b3894f3c3138dbc7713570cServer Information
- Server version/platform: Minehut
- Skript version: 2.4-beta5-MH (custom version)
Thanks in advance!
Making a lag-free /top balance command
in Discussion
Posted
I currently have code that is working fine and all, but everytime the command is run it loops the variable and could easily crash the server if someone were to spam it. I was wondering if anyone knew an alternate way to do this so that it didn't lag the server if someone spammed it but still worked fine.