Begin Mf_torch_toggleshort OnPcEquipshort TorchEquippedlong PcTargshort KeyPlong pEquipmentshort NoTorchshort DoesntHavelong invitemlong invcountlong invreflong pcrefshort Equipitemshort Comparefloat TimePassedshort KeyTimeshort DoOnceIf ( MenuMode ) returnendifIfx ( OnPcEquip ) set OnPcEquip to 0 Ifx ( TorchEquipped ) set Equipitem to 0 set DoesntHave to 1 ;this is a reset after Compare runs player->Additem, "Mf_toggle_shield" 1 ;incase the player isn't using a shield or 2hander player->Equip, "Mf_toggle_shield" player->RemoveItem, "Mf_toggle_shield" 1 setx pcref to xGetRef "player" setx invitem, invcount, invref to pcref->xInventory whilex ( DoesntHave ) setx Compare to xStringCompare invitem pEquipment If ( Compare == 0 ) ;the strings do match, meaning the item is in my inventory set DoesntHave to 0 endif If ( Invref == 0 ) set pEquipment to 0 set DoesntHave to 0 endif Ifx ( DoesntHave ) setx invitem, invcount, invref to pcref->xNextStack invref endif endwhile If ( DoesntHave == 0 ) If ( pEquipment != 0 ) set Equipitem to 1 endif endif Ifx ( Equipitem ) set EquipItem to 0 player->xEquip, pEquipment endif set TorchEquipped to 0 Else If ( Player->GetItemCount, "torch" > 0 ) Player-> Equip, "torch" set TorchEquipped to 1 ElseIf ( Player->GetItemCount, "torch_256" > 0 ) Player-> Equip, "torch_256" set TorchEquipped to 1 endif If ( TorchEquipped == 0 ) set NoTorch to 1 endif Ifx ( NoTorch ) set Equipitem to 0 set DoesntHave to 1 MessageBox, "You don't have a torch." player->additem, "Mf_toggle_shield" 1 player->equip, "Mf_toggle_shield" player->removeItem, "Mf_toggle_shield" 1 setx pcref to xGetRef "player" setx invitem, invcount, invref to pcref->xInventory whilex ( DoesntHave ) setx Compare to xStringCompare invitem pEquipment If ( Compare == 0 ) ;the strings do match, meaning the item is in my inventory set DoesntHave to 0 endif If ( Invref == 0 ) set pEquipment to 0 set DoesntHave to 0 endif Ifx ( DoesntHave ) setx invitem, invcount, invref to pcref->xNextStack invref endif endwhile If ( DoesntHave == 0 ) If ( pEquipment != 0 ) set Equipitem to 1 endif endif Ifx ( Equipitem ) set EquipItem to 0 player->xEquip, pEquipment endif set TorchEquipped to 0 set NoTorch to 0 Endif EndifEndIf;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX drop lit torch section XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;I might add some drop torch conditions here, if player has a weapon out and hits the toggler button it will equip shield or 2handedwep,,,;(cont.) and drop a torch (fight around lit torch in dark dungeons) player must put away weapon to equip a torch;XXXXXXXXXXXXXXXXXXXXXXXX set shield or 2 handed weapon below XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXIf ( TimePassed > 2 ) ;This isn't working like I expected it to set KeyTime to 1 set TimePassed to 0endifIf ( DoOnce == 0 ) set DoOnce to 1 set KeyTime to 1EndifIfx ( KeyTime ) ;This section is supposed to be locked out for 2 secs, but it gets locked out permenantly after the first PcTarg-> is registered setx KeyP to xKeyPressed, 80 If ( KeyP == 0 ) return endif Ifx ( KeyP ) setx PcTarg to xGetPCTarget if ( PcTarg == 0 ) return endif set KeyP to 0 setx pEquipment to PcTarg->xRefId MessageBox, "Item set." set TimePassed to ( TimePassed + GetSecondsPassed ) set KeyTime to 0 endifendifEnd