213410 Posted November 11, 2017 Share Posted November 11, 2017 (edited) Hello! I recently searched for mod that prevents player from running and sprinting and found idea, that it could be realised via SKSE and controls. So I tried to make a script, that checks if user equipped specific item (my script is attached to ebony boots), it then checks if player is running or sprinting and if so, holds shift button with player controls. The problem - nothing is happening in game. I think I made something horribly wrong with code, so I need help. I made only "Forward" for testing purposes, later I want to extend script for other controls. Scriptname ForceWalk extends Form ;Actor Property PlayerREF Auto ;Armor Property EbonyBoots Auto int bEquipped = 0 Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() bEquipped = 1 RegisterForControl("Forward") endif endEvent Event OnUnequipped(Actor akActor) if akActor == Game.GetPlayer() bEquipped = 0 UnregisterForControl("Forward") endif endEvent event OnControlDown(string control) if (control == "Forward") if Game.GetPlayer().IsRunning() == 1 || Game.GetPlayer().IsSprinting() == 1 if bEquipped == 1 Input.HoldKey(42) Debug.Notification("Forward") endif endif endif endEventPlease, help. Edited November 11, 2017 by 213410 Link to comment Share on other sites More sharing options...
213410 Posted November 13, 2017 Author Share Posted November 13, 2017 Bump. Can anyone share example of working OnControlDown event? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 13, 2017 Share Posted November 13, 2017 I cannot be certain. I think the problem may be that the script is on the boots itself. Try redoing the script with it attached to a player alias on a quest. Some objects when they are in inventories and containers will not process certain functions or events. I always found it better to be safe than sorry and script from the player's perspective instead. I.E. OnObjectEquipped instead of OnEquipped, OnObjectUnequipped instead of OnUnequipped, etc. Link to comment Share on other sites More sharing options...
213410 Posted November 14, 2017 Author Share Posted November 14, 2017 I will try to attach my script to quest, may be this will help. Thank you for answer. Link to comment Share on other sites More sharing options...
Recommended Posts