your 'if' Script should be put into a global Turnscript, instead of as an added~created~set'ted Script Attribute for your 'weapon' Object.
The problem is that your 'if' Script is not firing~activating~executing~running constantly. An Object's Script Attribute requires that you have to manually~force it to activate, such as if you created it in the GUI~Editor, as an added Verb, then during game play, the person would click on the Object's Verb's button or its hypertext link to activate it, or you'd have to have actual code lines that~to~will activate~call it.
A global Turnscript (if its 'enabled' Boolean Attribute checkbox in the GUI~Editor is checked) is constantly activating, which is what you want.
to create~add a global Turnscript:
click on the upper-left most 'object' in the left side's 'tree of stuff', so that it is highlighted, as this ensures that the Turnscript will be a global Turnscript.
now at the top of the screen, under the 'add' in the menu bar (I don't know why 'Turnscript' is not in the 'tree of stuff', as Timer is there, which is the same as a Turnscript, except it uses real time seconds, instead of the quest engine's underlying 'turn' internal coding), choose 'Turnscript'.
give the Turnscript a name, check in its 'enabled' Boolean Attribute checkbox (this causes it to be always activating from the moment the game begins), then add in your Scripts.
-------
about your script block...
if (Got(weapon)) {
player.visibility = player.visibility +2
}
else {
player.visibility = player.visibility +0
}
1. 'player.visibility = player.visibility + 2' will cause it to be constantly raising~increasing your 'visibility' by +2... which I don't think you want..., right?
do you want a 'event flag state' system ???, which is this conceptually:
player.visibility = 0 ---> 'whatever' is not visible
player.visibility = 1 ---> 'whatever' is opaque (half-visible)
player.visibility = 2 ---> 'whatever' is (fully) visible
which you would jsut use this instead:
if (Got(weapon)) {
player.visibility = 2
}
else {
player.visibility = 0
}
~ OR ~
do you want to do a '0-100' system, of gradual more visibility layers of the 'whatever' :
( this would use the 'player.visibility=player.visibility+2' )
( and I think this is self-explanatory, hopefully )
2. if you want to do the '0-100' system, then you don't want this code~script line~block:
else {
player.visibility = player.visibility +0
}
as there's no reason for it. You'd just want this for your full script block:
if (Got(weapon)) {
player.visibility = 2
}
unless you need to change between '0' and '2', then you'd need this:
if (Got(weapon)) {
player.visibility = 2
} else {
player.visibility = 0
}
--------------
and (well, Pixie, already beat me to it), are you seeing the 'visibility' displaying '0' or '2' during the game?