Editing Useful Scripts
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
==Karma Effects on Items== | |||
Script Type: Object | |||
Script Type:Object | |||
<pre> | <pre> | ||
scn KarmaEffect | |||
Begin OnEquip | |||
player.RewardKarma -650 | |||
End | End | ||
Begin OnUnequip | |||
player.RewardKarma 650 | |||
End | End | ||
</pre> | </pre> | ||
==Autoclosing door== | ==Autoclosing door== | ||
Line 210: | Line 24: | ||
Begin GameMode | Begin GameMode | ||
if closeDoor == 1 | |||
if doorTimer > 0 | |||
set doorTimer to doorTimer - getSecondsPassed | |||
else | |||
;close the door | |||
Activate | |||
; Lock | |||
set closeDoor to 0 | |||
endif | |||
endif | |||
End | End | ||
Begin OnActivate | Begin OnActivate | ||
Activate | |||
if IsActionRef Player == 0 ;if it shouldn't work for the player remove this... | |||
set doorTimer to 5 | |||
set closeDoor to 1 | |||
endif ;...and this | |||
End | End | ||
</pre> | </pre> | ||
Line 323: | Line 100: | ||
</pre> | </pre> | ||
== | ==Light switch== | ||
Script Type:Object | |||
<small>To be placed on an [[activator]], and [[Reference#Linked_Ref|linked]] to a light source or a x-marker [[Reference#Enable_Parent|parent]].</small> | |||
< | |||
<pre> | <pre> | ||
scn LightSwitchScript | |||
ref light | |||
short toggle | |||
begin onactivate | |||
if light == 0 | |||
set light to getlinkedref | |||
endif | |||
if toggle == 0 | |||
light.disable | |||
activate | |||
set toggle to 1 | |||
else | |||
light.enable | |||
set toggle to 0 | |||
activate | |||
endif | |||
end | |||
</pre> | </pre> |