Deleted60087771User Posted November 10, 2019 Share Posted November 10, 2019 hey i need some help to a project and it is my first time scriptingi wanted to make a necklace that when worn you begin sneaking.I tried to use: Game.GetPlayer().StartSneaking() but didn't work and i really don't know what else i can do or what i should do Link to comment Share on other sites More sharing options...
maxarturo Posted November 11, 2019 Share Posted November 11, 2019 (edited) You need to put this script in the necklace, if it is a custom an only one will be use you can edit base an insert the script there, but you should know that all other instances of this object that you will place in your mod will also have it, if you don't want that, then insert the script in the "Object Reference Window Property" in "Scripts". Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() Game.GetPlayer().StartSneaking() EndIf EndEvent Edited November 11, 2019 by maxarturo Link to comment Share on other sites More sharing options...
ReDragon2013 Posted November 12, 2019 Share Posted November 12, 2019 (edited) in addition to good posting of maxarturo, make sure your script has an unique name bendiNecklaceScript Scriptname bendiNecklaceScript extends ObjectReference ; https://forums.nexusmods.com/index.php?/topic/8137108-giveing-necklace-costum-properties-when-worn/ ; -- EVENTs -- 3 ; https://www.creationkit.com/index.php?title=StartSneaking_-_Actor EVENT OnInit() Debug.Trace("OnInit() - has been reached.. " +self) ; debugging only ENDEVENT EVENT OnEquipped(Actor akActor) IF (akActor == Game.GetPlayer()) ELSE RETURN ; - STOP - not equipped by player ENDIF ;--------------------- IF akActor.IsSneaking() ELSE ; will nott work if the actor is falling, swimming, or in the middle of performing an attack at the time it is called. akActor.StartSneaking() ; start player sneaking ENDIF ENDEVENT EVENT OnUnEquipped(Actor akActor) IF (akActor == Game.GetPlayer()) ELSE RETURN ; - STOP - not unequipped by player ENDIF ;--------------------- IF akActor.IsSneaking() akActor.StartSneaking() ; player is already sneaking cancel sneaking ENDIF ENDEVENT Edited November 12, 2019 by ReDragon2013 Link to comment Share on other sites More sharing options...
Recommended Posts