Jump to content

chat on join skript [help]


seamzers

Recommended Posts

so basically im trying to make a skript where if the player hasnt moved from when the block they were at when they joined then they cant chat.

heres my current code:

#this is just a anti-spam that it uses			
on chat:
	if {%player%::message} isn't set:
		set {%player%::message} to false
	if {%player%::message} is false:
		wait 2 ticks
		set {%player%::message} to true
		wait 2 seconds
		set {%player%::message} to false
		
on chat:
	if {%player%::message} is true:
		cancel event
		send "&cPlease Wait 2 Seconds Until You Chat Again" to player
#this is the skript not working ↓↓↓↓↓↓↓
		
on join:
	if player's location is x10722, y137, z9628:
	set {%player%::message} to false

the error message i get is:

 

2023-02-05_15.52.02.png

Link to comment
Share on other sites

Your code is very messy, try this (not tested)

on chat:
    if {playersjoinlocation::%player's uuid%} is player's location:
        send "&cMove before chatting!"
    else:
        delete {playersjoinlocation::%player's uuid%}
		
on join:
    set {playersjoinlocation::%player's uuid%} to player's location

on quit:
    delete {playersjoinlocation::%player's uuid%}

 

Edited by iamsif
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...