I didn't test it, but this should give you an idea how to achieve what you want:
askald,104,205,5 script PvP Gold Room 4_F_KAFRA1,{
doevent "gold_room_main::OnTalk";
}
// warp portal back prontera
ordeal_3-2,123,123,0 warp gold_room_back_prt 1,1,prontera,155,181
// peco peco summon
ordeal_3-2,0,0,0,0 monster Gold 1954,100,60000,0,"gold_room_main::OnKill"
- script gold_room_main -1,{
OnInit:
// gold room map
.map$ = "ordeal_3-2";
// entrance fee
.zeny_cost = 500000;
// rate to get gold
.rate = 100;
// points per kill
.points_per_kill = 2;
// gold random amount
setarray(.gold_amount, 1, 5);
setmapflag .map$,mf_noteleport;
setmapflag .map$,mf_nobranch;
setmapflag .map$,mf_nosave;
setmapflag .map$,mf_nomemo;
setmapflag .map$,mf_noreturn;
setmapflag .map$,mf_nowarp;
setmapflag .map$,mf_nowarpto;
setmapflag .map$,mf_pvp;
end;
OnTalk:
mes "Enter Gold Room?";
next;
if(.zeny_cost) {
mes F_InsertComma(.zeny_cost) + " Zeny";
close;
}
switch(select("Enter Gold Room","Exchange Gold Point","Information")) {
case 1:
if (Zeny < .zeny_cost) {
mes "Not enough Zeny.";
break;
}
Zeny -= .zeny_cost;
warp .map$,0,0;
end;
case 2:
mes "You got " + F_InsertComma(#GOLDPOINTS) + " Points";
input .@value,0,#GOLDPOINTS;
if (.@value == 0) {
mes "Exchange canceled.";
break;
}
if(checkweight(969, .@value)) {
#GOLDPOINTS -= .@value;
getitem(969, .@value);
mes "Gained " + .@value + " Gold.";
break;
}
break;
case 3:
mes "In this room you will have the chance to get " + .points_per_kill + " points for each monster killed, but if another player kills you you lose all your points! 1 point gets you 1 gold";
break;
}
close;
OnKill:
if(rand(100) < .rand) {
#GOLDPOINTS += .points_per_kill;
dispbottom "You gained " + .points_per_kill + " Points. You do have " + F_InsertComma(#GOLDPOINTS) + " Points now.";
}
end;
OnPCKillEvent:
if (strcharinfo(3) != .map$) end;
.@killer_name$ = strcharinfo(0);
.@killed_name$ = rid2name(killedrid);
.@killed_char_id = getcharid(0, .@killed_name$);
.@killed_gold_points = getvar("#GOLDPOINTS", .@killed_char_id);
#GOLDPOINTS += .@killed_gold_points;
dispbottom("You killed " + .@killed_name$ + " and got all his points. You do have " + F_InsertComma(#GOLDPOINTS) + " Points now.";
attachrid(killedrid);
#GOLDPOINTS = 0;
dispbottom("You died and lost all your points to " + .@killer_name$ + ".");
}