antstubell Posted July 26, 2019 Share Posted July 26, 2019 Just taking a quick break from other scripting adventure, some of you huys know what I mean and wrote this script which to me seems like it should work but... it doesn't.Scenario: Based upon a post I made about player should not be able to equip a torch, go into water and maigically it is still alight when player leaves water - I hit upon this idea. When player is completely submerged in water i.e. swimming, any torches that he is carrying and has equipped should be ruined and removed from inventory. Scripts compiles and works but no torches are removed from inventory, also need a way to remove an equipped torch if player is holding one. Actor Property PlayerREF AutoGlobalVariable Property MyCount AutoInt Property TCount AutoLight Property Torches AutoMessage Property FirstTime AutoMessage Property Discard AutoSound Property MySND AutoEVENT onTriggerEnter(ObjectReference akActionRef)if akActionRef == PlayerRefTCount == PlayerRef.GetItemCount(Torches)Game.GetPlayer().RemoveItem(Torches, TCount)If MyCount.GetValue() == 0FirstTime.Show()EndIfIf MyCount.GetValue() > 0Discard.Show()EndIfMyCount.SetValue(1)EndIfEndEvent Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 26, 2019 Share Posted July 26, 2019 You have two equal signs between TCount and the GetItemCount function call. Two equal signs indicate a comparison between each side. While a single equal sign indicates taking the value on the right and shoving it into the variable on the left. Surprised it compiled without complaint. And if that is just a typo from posting on the forum, make sure that all your properties are properly filled. Link to comment Share on other sites More sharing options...
antstubell Posted July 26, 2019 Author Share Posted July 26, 2019 Yeah, it was the double ==Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts