Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Const
- BPIndex = 1
- RingID = 3051
- MinHealth = 6000
- HealthToRemoveRing = 7000
- var
- G:integer;
- Function GetItemFromOpenBackpack(ID:integer):TItem;
- begin
- result := nil;
- UpdateWorld;
- for x := 0 to Self.Containers.Count - 1 do
- begin
- if x >= Self.Containers.Count then break;
- for y := 0 to Self.Containers.Container[x].Count do
- begin
- if y >= Self.Containers.Container[x].Count then break;
- if Self.Containers.Container[x].Item[y].ID = ID then
- begin
- result := Self.Containers.Container[x].Item[y];
- G := x;
- Exit;
- end;
- end;
- end;
- end;
- while not terminated do
- begin
- If HealthToRemoveRing <= MinHealth Then
- begin
- Self.DisplayText('HealthToRemoveRing must be higher then MinHealth! Script will turn off now. Please try again.');
- exit;
- end;
- UpdateWorld;
- if Self.Health <= MinHealth then
- begin
- if self.ring.ID = 0 then
- begin
- Ring := GetItemFromOpenBackpack(RingID);
- if Ring <> nil then
- Ring.MoveToBody(Self.Ring,0);
- else Self.DisplayText('The Ring wasnt found in any opened backpack.');
- end;
- end;
- UpdateWorld;
- if Self.Health >= HealthToRemoveRing then
- begin
- if self.ring.id <> 0 then
- begin
- Ring := Self.Ring;
- Ring.MoveToContainer(Self.Containers.Container[BPIndex - 1],0,0);
- end;
- end;
- sleep(500);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement