HunterSweet Posted August 10, 2012 Share Posted August 10, 2012 I have two scripts. One keeps a count (and adds to it), the other subtracts from the count.They are essentially: Scriptname CountTestScript Extends ObjectReferenceActor Property PlayerRef AutoInt Property Count AutoMiscObject Property Spoon AutoMiscObject Property Knife AutoMiscObject Property Fork AutoObjectReference Property Plate AutoObjectReference Property Fork AutoObjectReference Property Knife AutoObjectReference Property Spoon Auto EVENT OnActivate(ObjectReference TriggerRef) If PlayerRef.GetItemCount (Spoon) >= 1 PlayerRef.RemoveItem (Spoon) Spoon.Enable() Count = Count+1 EndIf If PlayerRef.GetItemCount (Knife) >= 1 PlayerRef.RemoveItem (Knife) Knife.Enable() Count = Count+1 EndIf If PlayerRef.GetItemCount (Fork) >= 1 PlayerRef.RemoveItem (Fork) Fork.Enable() Count = Count+1 EndIf If Count >=3 Plate.Enable() EndIf EndEVENT Scriptname SpoonScript Extends ObjectReferenceObjectReference Property Spoon AutoCountTestScript Property OtherScript AutoMiscObject Property Spoon AutoActor Property PlayerRef Auto EVENT OnActivate(ObjectReference TriggerRef) Spoon.Disable() PlayerRef.AddItem(Spoon) OtherScript.Count = OtherScript.Count-1EndEVENT Second Script doesn't compile right: "No viable alternative at input 'Count'"Is it possible to change an integer's value from another script? Link to comment Share on other sites More sharing options...
Recommended Posts