PreStaffScript
SetEventScript [ItemSwing] [NecroStaff] [StaffScript]
You must run this script before this next script. [NecroStaff] can be replaced with any staff or even item. [StaffScript] is the name of the script you want the staff to run when swung.
StaffScript
If
Intersect [ray] [vrel:0,0,0] [vrel:1024,0,0] [players]
Then
Context [player] [target]
Teleport [player] [512,200,512]
This will teleport a player to any specified coordinates. You must set the coordinates somewhere within the jail.