I'm in the middle of writing my first script and I want to give people a choice of Teleports so I figured a case statement would be the easiest thing to use, however I am kind of confused on how that work.
I want the user to be able to pick which area to teleport to in the Declare Players section
Simba Code:Teleport := '' //Choose 0 (Edgeville), 1 (CastleWars), 2 (Fight Caves)
This I think should work.
However, how do I set up the case to work with this. I'm fairly certain this wont work even without having any of the teleport information in it.
Simba Code:Procedure TeleporttoBank; //Sets which bank to teleport to
begin
Case Teleport of
0. Edgeville
1. CastleWars
2. FightCave
end;
if Case=0 then // Edgeville Tele will require glory
begin
end else
if Case=1 then //CastleWars tele will require dueling ring
begin
end else
if Case=2 then //FightCave tele will require Tokkul-Zo ring (No need to get new ones)
begin
end else
begin
TerminateScript;
end;
end;
E: I remember seeing a guide on Cases, but I couldn't find it when I did a search so if anyone knows where it went to, feel free to post a link!
E2: Small change in code, but still essentially the same.




Reply With Quote











