This is not to discourage you, but I believe a drag script is too complex for you. Try to make something much more easy. An example of something easy to code is to change the player's chat when they say "hi".

Also, just a few pointers on syntax

- Use semi colons after each statement

- Methods/Functions are cased in curly brackets, just imagine a box.

PHP Code:
function onPlayerChats() {
  if (
condition) {
    
// stuff
  
} else if (condition) {
    
// stuff
  
} else {
    
// stuff
  
}