1) Do you have ops on that channel? (Only ops can give ops)
2) Is the user already opped? (Same mode might be ignored)
3) You might have other "on input" events in other scripts loaded that interfere. To resolve this, move this script ontop in file order (after adding/loading it in the remotes, go to "file" > "oder" and move the script to the topmost position).