Jump to content

How do I fix this? ONLY 1 error, please help!


Skripter01

Recommended Posts

Skript: Money Generator

  1. on join:
  2.     wait 1 tick
  3.     while player is alive:
  4.         if blocks in radius 10 of player contains emerald block:
  5.             add 4 to player's balance
  6.             send "&a&l+ $4" to player
  7.             wait 1 second
 
Ingame it says: Encountered 1 Error, (In line 5)
Edited by Skripter01
Forgot a few details.
Link to comment
Share on other sites

On 9/14/2020 at 10:14 AM, Skripter01 said:

Skript: Money Generator

  1. on join:
  2.     wait 1 tick
  3.     while player is alive:
  4.         if blocks in radius 10 of player contains emerald block:
  5.             add 4 to player's balance
  6.             send "&a&l+ $4" to player
  7.             wait 1 second
 
Ingame it says: Encountered 1 Error, (In line 5)

Yes, TheGoose is right, you should install the SkVault or Vault plugin if you want it to work, otherwise it will result in an error.

Hope that helps!

Link to comment
Share on other sites

  1. on join:
  2.     wait 1 tick
  3.     while player is alive:
  4.         if blocks in radius 10 of player contains emerald block:
  5.             add 4 to player's balance
  6.             send "&a&l+ $4" to player
  7.             wait 1 second
even if line 5 was correct, the skript alone wouldn't work. you have to use variables
 

join:
    wait 1 tick
    while player is alive:
        if blocks in radius 10 of player contains emerald block:
        add 4 to {balance}
        send "&a&l+ $4" to player
        wait 1 second

command balance:
    send "&aBalance: &e{balance}" to player

# if you want to make it so you can purchase things tell me and ill add that

Link to comment
Share on other sites

24 minutes ago, Tmoa said:
  1. on join:
  2.     wait 1 tick
  3.     while player is alive:
  4.         if blocks in radius 10 of player contains emerald block:
  5.             add 4 to player's balance
  6.             send "&a&l+ $4" to player
  7.             wait 1 second
even if line 5 was correct, the skript alone wouldn't work. you have to use variables
 

join:
    wait 1 tick
    while player is alive:
        if blocks in radius 10 of player contains emerald block:
        add 4 to {balance}
        send "&a&l+ $4" to player
        wait 1 second

command balance:
    send "&aBalance: &e{balance}" to player

# if you want to make it so you can purchase things tell me and ill add that

Yours won't work. They are probably using vault and Essentials eco so they are using add 4 to player's balance so it will add to that balance. Adding to the variable {balance} does not add to the essentials eco and is also a global variable. So everyone will have the same amount of money. And your indents were wrong too. 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

on join:
    wait 1 tick
    while player is alive:
        if blocks in radius 10 of player contains emerald block:
            add 4 to player's balance
            send "&a&l+ $4" to player
            wait 1 second

See, Skript treats "balance" as in the balance you have in Vault/SkVault. If you do not have them installed, I suggest making your own economy with variables. Here's a balance script I just made:

command /balance [<text>] [<number>] [<offlineplayer>]:
	aliases: bal
	trigger:
		if {bal::%player's uuid%} is not set:
			set {bal::%player's uuid%} to 0
		if arg-1 is not set:
			send "&aBalance: &a{bal::%player's uuid%}" to player
		else if arg-1 is "add":
			if player has permission "bal.add":
				if arg-2 is not set:
					send "&cYou must set the number of coins to add" to player
				if arg-3 is not set:
					add arg-2 to {bal::%player's uuid%}
					send "&bAdded &c$%arg-2%&b to your balance" to player
		else if arg-1 is remove:
			if player has permission "bal.remove":
				if arg-2 is not set:
					send "&cYou must set the number of coins to remove" to player
				if arg-3 is not set:
					remove arg-2 from {bal::%player's uuid%}
					send "&bRemoved &c$%arg-2%&b from your balance" to player
  			

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...