Jump to content

Help with a script


Xyzy

Recommended Posts

I'm trying to make a script that automatically resizes any NPC/player that wears a certain armor (in this case the enclave power armor). The script works fine for the player, but I can't get it to work for NPCs. Here's the script:

 

ScriptName ArmorEnclaveSize

 

ref user

 

Begin OnEquip

set user to GetContainer

user.SetScale 1.2

End

 

Begin OnUnequip

set user to GetContainer

user.SetScale 1

End

 

 

Thanks in advance. As you can probably see, I'm a real novice at scripting.

Link to comment
Share on other sites

ScriptName ArmorEnclaveSize

 

ref user--- not sure but here you have to fill in npc or the ref from the npc( it's probably a refscript)

 

Begin OnEquip

set user to GetContainer

user.SetScale 1.2

End----- this has probably been changed in endif coz here you are ending the script( not sure bout this one coz you say it works for you)

 

Begin OnUnequip

set user to GetContainer

user.SetScale 1

End

 

 

i'm a noob at it too :confused:

but it seems that you are activating your script and i think that the npc don't get the command to activate it

 

gr deepside

Link to comment
Share on other sites

Well, the script looks fine--and as you say, it works on the player. Are the NPCs equipping the item? That's the only time "SetScale 1.2" is going to work. If they start out with the item on, you'll want to try it in a GameMode block, like below. I also included a scale tracking variable so they can go back to their original scale if they weren't 1.0 to start with.

 

ScriptName ArmorEnclaveSize

float fScale
reference rUser

begin GameMode
if rUser != GetContainer
	set rUser to GetContainer
endif

if rUser.GetEquipped ArmorEnclave 
	if rUser.GetScale != 1.2
		set fScale to rUser.GetScale
		rUser.SetScale 1.2
	endif
elseif rUser.GetScale == 1.2
	rUser.SetScale fScale
endif
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...