Jump to content

Variable Not Integer


AgentGamerPro

Recommended Posts

I'm getting an error saying "Can't compare {Balance::%{_p}'s uuid%} with an integer" here is my skript:

function BuyWoodSword(p: player):
	if {balance::%{_p}'s uuid%} is >= 300:
		remove 300 from {balance::%{_p}'s uuid%}
		give {_p} 1 wooden sword
		send "&aSuccessfully purchased &2Wooden Sword!" to {_p}
	else:
		send "&4&lError: &cInsufficent Balance!" to {_p}

anyone know a solve to this

Edited by AgentGamerPro

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Lifestealed | Minecraft Servers
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - Present

 

Link to comment
Share on other sites

For some reason in Skript you can't use expressions like %{_p}'s uuid% in functions... Instead you have to set a variable to their uuid, like {_u}, and call that instead of {_p}'s uuid.

function BuyWoodSword(p: player):
	set {_u} to uuid of {_p}
	if {balance::%{_u}%} is >= 300:
		remove 300 from {balance::%{_u}%}
		give {_p} 1 wooden sword
		send "&aSuccessfully purchased &2Wooden Sword!" to {_p}
	else:
		send "&4&lError: &cInsufficent Balance!" to {_p}

 

  • Like 2

» IGN: _iZ_ «

» Joined: 12/18/2016 «

» VIP: 1/13/2018 «

» Helper: 1/29/2021 «

» [<3]: 5/8/2021 «

» Skript dev «

» Discord: iZz#0420 «

I have diabetes

React to this if I was helpful, found this interesting, or you're just nice 🙂

Link to comment
Share on other sites

10 hours ago, _iZ_ said:

For some reason in Skript you can't use expressions like %{_p}'s uuid% in functions... Instead you have to set a variable to their uuid, like {_u}, and call that instead of {_p}'s uuid.


function BuyWoodSword(p: player):
	set {_u} to uuid of {_p}
	if {balance::%{_u}%} is >= 300:
		remove 300 from {balance::%{_u}%}
		give {_p} 1 wooden sword
		send "&aSuccessfully purchased &2Wooden Sword!" to {_p}
	else:
		send "&4&lError: &cInsufficent Balance!" to {_p}

 

Still can't compare with an integer :/

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Lifestealed | Minecraft Servers
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - Present

 

Link to comment
Share on other sites

1 hour ago, AgentGamerPro said:

Still can't compare with an integer 😕

Remove the is in line 3. Its just if {var} >= 3 not if {var} is >= 3

  • Thanks 1

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

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...