Jump to content

Skript not working


Hyper611

Recommended Posts

I have a server that you can dupe stuff with /dupe and was trying to make a few things not able to dupe.
The pink netherite still dupes while the blue netherite doesn't. Can anyone help?

 

command /dupe:
	cooldown: 2 seconds
	cooldown message: This command is on cooldown
	trigger:
		if name of player's held item is "&dPink Netherite":
			send "&cYou can not dupe this item!" to player
		else:
		if name of player's held item is "&1Blue Netherite":
			send "&cYou can not dupe this item!" to player
		else:
			give player player's held item

 

Link to comment
Share on other sites

Its probably because its running both if statements. When you are holding the pink netherite, it runs the if player's held item is blue netherite line, and since the pink netherite is not that, it still dupes it. Do something like this

set {_blocked::*} to stick, stone, bedrock
if {_blocked::*} contains player's tool:
	send "You may not dupe this item"
else:
	give player player's held item

And then just set the local blocked list variable to the items you don't want players to be able to dupe.

Discord - tarna256

In-game name - _Tarna_

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

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

[VIP] - 7/27/2020

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

6 minutes ago, _Tarna_ said:

Its probably because its running both if statements. When you are holding the pink netherite, it runs the if player's held item is blue netherite line, and since the pink netherite is not that, it still dupes it. Do something like this


set {_blocked::*} to stick, stone, bedrock
if {_blocked::*} contains player's tool:
	send "You may not dupe this item"
else:
	give player player's held item

And then just set the local blocked list variable to the items you don't want players to be able to dupe.

Ok thanks!

Link to comment
Share on other sites

11 hours ago, _Tarna_ said:

Its probably because its running both if statements. When you are holding the pink netherite, it runs the if player's held item is blue netherite line, and since the pink netherite is not that, it still dupes it. Do something like this


set {_blocked::*} to stick, stone, bedrock
if {_blocked::*} contains player's tool:
	send "You may not dupe this item"
else:
	give player player's held item

And then just set the local blocked list variable to the items you don't want players to be able to dupe.

 didn't work 😕

Link to comment
Share on other sites

It's caused by your indentation being wrong, but instead you can use the word stop to stop the script.

I've changed your original script in the code block below

command /dupe:
	cooldown: 2 seconds
	cooldown message: This command is on cooldown
	trigger:
		if name of player's held item is "&dPink Netherite":
			send "&cYou can not dupe this item!" to player
			stop
		if name of player's held item is "&1Blue Netherite":
			send "&cYou can not dupe this item!" to player
			stop
		give player player's held item

 

[<3]

DMs open - Discord » mrtibo | or send a forum message

Link to comment
Share on other sites

6 minutes ago, MrTibo said:

It's caused by your indentation being wrong, but instead you can use the word stop to stop the script.

I've changed your original script in the code block below


command /dupe:
	cooldown: 2 seconds
	cooldown message: This command is on cooldown
	trigger:
		if name of player's held item is "&dPink Netherite":
			send "&cYou can not dupe this item!" to player
			stop
		if name of player's held item is "&1Blue Netherite":
			send "&cYou can not dupe this item!" to player
			stop
		give player player's held item

 

Thank you!

Link to comment
Share on other sites

Moved to Skript

Please post in the correct category next time

Discord - tarna256

In-game name - _Tarna_

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

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

[VIP] - 7/27/2020

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