Jump to content

Dropping Items Skript V 2.0: /drop to drop items


Lerx

Recommended Posts

Alright this is a skript i made myself partially, so it's not perfect, but it is NOT WORKING. (ignore the .drop it should be /drop)

Screen_Shot_2020-06-08_at_6.27.59_PM.png

command /drop:
    trigger:
        send "&cYou can drop items for 10 seconds now!" to player
        make console execute command " /pex user %player% timed add item.drop 10 VoidWorld"

 

The dropping of items works as it should, not dropping items BEFORE you say the command.

But after you say the command (/drop) it still does not let you drop items.

I think this is an issue with pex not adding it to the player but i am not sure.

 

Thanks.

 

Link to comment
Share on other sites

This can be easily be covered without the use of "make console execute...".
My example would be like this:

on join:
	set {%player%::candrop} to 0
	# this is to avoid player from bypassing the ability to drop

command /drop:
	cooldown: 1 minute #optional
	trigger:
		send "&cYou can drop items for 10 seconds now!"
		set {%player%::candrop} to 1
		wait 10 seconds
		send "&cYou can't drop items anymore."
		set {%player%::candrop} to 0
		
on drop:
	player does not have permission "admin" # admins can bypass drop cooldown
	{%player%::candrop} is 0 # players who used /drop will bypass this for 10 seconds
	cancel event
	send "&cYou cannot drop items! Do /drop first!"

If you want to use this example, make sure to either remove the plugin that stops from players dropping items or add the drop permissions to the default group.

It would be 256952237757169664.png.d18a09670746c6c6079d9c16a0ee3647.png if you could upvote my post if you found it helpful.

image.png.beca96975a3b4f2ba756ddf6d7eebbb2.png

Link to comment
Share on other sites

1 hour ago, Ria said:

This can be easily be covered without the use of "make console execute...".
My example would be like this:


on join:
	set {%player%::candrop} to 0
	# this is to avoid player from bypassing the ability to drop

command /drop:
	cooldown: 1 minute #optional
	trigger:
		send "&cYou can drop items for 10 seconds now!"
		set {%player%::candrop} to 1
		wait 10 seconds
		send "&cYou can't drop items anymore."
		set {%player%::candrop} to 0
		
on drop:
	player does not have permission "admin" # admins can bypass drop cooldown
	{%player%::candrop} is 0 # players who used /drop will bypass this for 10 seconds
	cancel event
	send "&cYou cannot drop items! Do /drop first!"

If you want to use this example, make sure to either remove the plugin that stops from players dropping items or add the drop permissions to the default group.

alright i forgot to say in the top it's a skript that prevents players from dropping on drop:
   

player doesn't have permission "item.drop"
    cancel event
    send "&8( &4&l!&8 ) &cDropping items is disabled. To drop items, use /drop." to player

But this looks like it would cover both, i'll edit this in about 5 minutes after i test!

 

 

Edited by Lerx
Link to comment
Share on other sites

A more efficient way of doing it so you don't have useless vars could be this

on join:
	delete {candrop::%player%}
	# this is to avoid player from bypassing the ability to drop

on quit:
	delete {candrop::%player%}
      
command /drop:
	cooldown: 1 minute #optional
	trigger:
		send "&aYou can drop items for 10 seconds now!"
		set {candrop::%player%} to true
		wait 10 seconds
		delete {candrop::%player%}
		
on drop:
	player does not have permission "admin" # admins can bypass drop cooldown
	{candrop::%player%} is not set # players who used /drop will bypass this for 10 seconds
	cancel event
	send "&cYou cannot drop items! Do /drop first!"

 

Storing a lot of useless variables will use space albeit not much, but it adds up, and using {candrop::*} instead of {%player%::*} will make it easier to clear if something happens and the list gets large.

 

1 hour ago, Ria said:

This can be easily be covered without the use of "make console execute...".
My example would be like this:


on join:
	set {%player%::candrop} to 0
	# this is to avoid player from bypassing the ability to drop

command /drop:
	cooldown: 1 minute #optional
	trigger:
		send "&cYou can drop items for 10 seconds now!"
		set {%player%::candrop} to 1
		wait 10 seconds
		send "&cYou can't drop items anymore."
		set {%player%::candrop} to 0
		
on drop:
	player does not have permission "admin" # admins can bypass drop cooldown
	{%player%::candrop} is 0 # players who used /drop will bypass this for 10 seconds
	cancel event
	send "&cYou cannot drop items! Do /drop first!"

If you want to use this example, make sure to either remove the plugin that stops from players dropping items or add the drop permissions to the default group.

 

Edited by ReportCards
  • Like 1

Zora

💬 » Discord: @reportcards

 

Link to comment
Share on other sites

Okay, everything technical works, they can't drop and when they do /drop they can now drop items for 10 seconds.

But when they try and drop before they do /drop, it prevents them, but it does not activate this part of the skript. In the end it's probably minor, but i would like my players to know how to drop.

send "&cYou cannot drop items! Do /drop first!"
Edited by Lerx
Link to comment
Share on other sites

Oh that usually should show it, but well apparently it didn't this time. I just tested the skript and all you need to add is "to the player" after the send message. Pretty much like that:

send "&cYou cannot drop items! Do /drop first!" to the player

 

It would be 256952237757169664.png.d18a09670746c6c6079d9c16a0ee3647.png if you could upvote my post if you found it helpful.

image.png.beca96975a3b4f2ba756ddf6d7eebbb2.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...