I have fixed your code up, see if this functions correctly.
PHP Code:
on *:TEXT:!58x2:#FCNAME:{
if ($nick isvop #) or ($nick isreg #) {
msg # 4only ranks may start a 58x2.
halt
}
if ($2 !ison #) {
msg # $2 is not a valid nick.
halt
}
if (!$3) {
msg # Invalid format. Use: !58x2 user pot
halt
}
set $2 $3
var %preroll = $rand(2,100), %p = $gettok($3,3,32), %d2 = $gettok($2,2,32)
if (%preroll < 58) {
msg # 4 $nick 9has rolled a 4[ %preroll ]9 sorry 4 %d2 9 you lost the %p pot!
}
else {
msg # 4 $nick 9has rolled a 4[ %preroll ]9 congrats 4 %d2 9 you won the %p pot!}
}
}