What peachykeen is saying is that the 2 snippets of code where you just moved the MessageBox are essential identical. If one works, the other should work also, unless some other condition is not being met.
peachykeen also raises an interesting point about the timer...
if ( timer >= 15.0 ) if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination. setHello 30 ;sets Tii Guar back to being able to initiate dialogue set acompanion to 1 set greeting to 1 set supplies to 3 MessageBox "Timer done!" set timer to 0 else set timer to ( timer + GetSecondsPassed ) ; THIS is the line in question endifendif
The line in question increases the timer, but it is already contained within the "if ( timer >= 15.0 )" block, therefore the timer has already reached 15 seconds.
I would recommend something more like what peachykeen suggested, but that will make the timer start straight away, whereas am I right in thinking that you only want the timer to start when supplies == 2?
In which case... oh, here you go
Spoiler begin "Tii_Guar_Companion_Script";Variables.short topics ;used to add all necessary topics at the right times to Tii Guar.short acompanion ;used for setting AI to follow player.short objectCount ;used for checking how many arrows Tii Guar has.short supplies ;used for the feature of resupplying Tii Guars inventory.short greeting ;used for checking distance for force greet.short repair ;used for reparing Tii Guar's equipment.'short NoLore ;used to prevent Tii Guar from having standard Morrowind lore topics.short timerOnfloat timer ;used for timing an event for resupplying.;set variables.set objectCount to ( GetItemCount, "chitin arrow" ) ;sets objectCount to the amount of arrows Tii Guar has in her inventory.;control all topicsif ( topics == 0 ) ;topics added the moment you talk to Tii Guar AddTopic, "Why are you in Seyda Neen?" AddTopic, "Why do you trade at Arrille's Tradehouse?" AddTopic, "Why are you a hunter?" AddTopic, "That is a very nice amulet." AddTopic, "Who is Hircine?" AddTopic, "Supplies" set topics to 1endif;controls setting Tii Guar as a companion.if ( acompanion == 1 ) if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player. if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs. "aa shaddow_Tii Guar"-> AIFollow Player 0, 0, 0, 0 ;sets Tii Guar to Follow player. endif endifelseif ( acompanion == 0 ) if ( GetCurrentAIPackage != 0 ) ;if Tii Guar isn't already Wandering. if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs. "aa shaddow_Tii Guar"-> AIWander, 0, 0, 0, 0, 30, 0, 40, 40, 30, 10, 0, 0 endif endifendif;control timerif ( timerOn == 1 ) if ( timer < 15.0 ) Set timer To ( timer + GetSecondsPassed ) else if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination. SetHello 30 ;sets Tii Guar back to being able to initiate dialogue Set supplies To 3 Set acompanion To 1 Set timer To 0 MessageBox "Timer done." endif endifendif;control resupplying (for use with objectCount, timer, timerOn, acompanion, and greeting)if ( GetPCCell "Seyda Neen, Arrille's Tradehouse" == 1 ) ;makes sure Tii Guar and the player are in the right cell. if ( supplies == 0 ) if ( objectCount < 25 ) ;if Tii Guar has less then 25 chitin arrows. if ( acompanion == 1 ) set supplies to 1 else return endif ;only ends checking if Tii Guar is your companion. endif ;only ends checking objectCount. elseif ( supplies == 1 ) if ( GetDistance, Player <= 200 ) if ( greeting == 0 ) ForceGreeting set acompanion to 0 set supplies to 2 ;after the greeting is forced moves to the next step. endif ;only ends checking distance and setting greeting. endif ;only ends checking greeting. elseif ( supplies == 2 ) if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player. if (GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs. setHello 0 ;makes Tii Guar not initiate voice dialogue wile the walking. "aa shaddow_Tii Guar"-> AITravel, -324, -64, 387 ;makes Tii Guar start heading up stairs. set timerOn to 1 MessageOn "Timer is on." endif endif endif elseif ( supplies == 3 ) if ( greeting == 1 ) if ( GetDistance, Player <= 200 ) MessageBox "Player is close enough!" if ( GetLOS, Player == 1 ) ForceGreeting set greeting to 0 ;this is where set repair to 1 will be. set supplies to 5 ;change to 0 when repair feature is implemented. endif endif endif endif ;ends the whole block.endif ;ends checking if Tii Guar and the player are in the right cell.end
I've just made a few tweaks - let me know how it goes, and what messageboxes pop up (including if any pop up multiple times).
Good work so far anyway! Putting in lots of comments is definitely a good thing to do if you're new to scripting. You can go ahead and put in more MessageBoxes if you want, they can help you see what the code is doing, and if it's not working then why it's not working; if you can track down exactly what line it's getting stuck at, you should be able to fix it.
Also, objectcount is being set every frame - is it being used in dialogue or anywhere outside this script? Because otherwise I'd only get the arrow count when you need it.