Jump to content

Skript Anti-Grief not working


TechLover3000

Recommended Posts

I have been trying to make a Minehut server which has a PvP arena, so currently I am trying to make sure no one can grief any of the blocks. Here's a sample Skript code that I am using as the non grief code (I replace the '(item name)' with the name of the item, e.g. spruce planks):

on break of (item name):
	if player's gamemode is survival:
		send "&c&lHey!&r You can't break that block there!" to player
		cancel event

Recently I ran into a problem with this code with dark oak signs (as seen in the video at the bottom). Basically, it only cancels the event if the sign is at a certain orientation, i.e. it will not cancel the event if the sign is on a wall. I have been using the code below to make it so that people cannot grief the signs and this code works for other items (if you replace 'dark oak signs' with the item name, plural) such as spruce planks, spruce logs and spruce leaves.

on break of dark oak signs:
	if player's gamemode is survival:
		send "&c&lHey!&r You can't break that block there!" to player
		cancel event

I am pretty sure the problem with some of the signs not cancelling the event is the fact the some of them are on walls, and some are not. Also, is there a piece of Skript code which disables PvP?

Thanks!

TechLover3000

Link to comment
Share on other sites

The orientation of a block shouldn't matter when it is being checked to see if it is broken. Can you try to place a sign on the wall in survival and try to break it in survival, and see what that does?

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

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