LadyEdith Posted January 14, 2020 Share Posted January 14, 2020 I've been trying to attach a script to a doorthat the player enters that will only disablethe player's ability to use weapons. This is the script I have assembled so far. Scriptname DisableViolentPlayerControls Extends ObjectReferenceObjectReference Property DoorToGardenHills AutoEvent OnActivate(ObjectReference AkActionRef) Game.DisablePlayerControls(false, true, false, false, false, false, false)endEvent ///////I receive the following error ///// C:\Users\billi\AppData\Local\Temp\PapyrusTemp\DisableViolentPlayerControls.psc(6,6): cannot call the member function DisablePlayerControls alone or on a type, must call it on a variableNo output generated for DisableViolentPlayerControls, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on DisableViolentPlayerControls ////the goal is after this door is activated player combatwill be disabledI'm wondering if it is a syntax issue? I attached the script to a door in the worldand not a base object.Thank you for any help you can provide Billie Lyn Link to comment Share on other sites More sharing options...
StormWolf01 Posted January 14, 2020 Share Posted January 14, 2020 (edited) Hiya Billie! I'm not trying to be a butthead or anything. But you'd probably have a lot better chance of getting this answered in the forums for what game you're asking about. This section of the boards is the nexus site related stuff :wink: You can ask a member of the staff to move it to the game's forums by clicking on the ! Report button there at the lower left corner of your post. Just explain to them that you would like to have it moved, which game forums you'd like it in. And they'll take care of it as soon as somebody gets a chance :smile: Good luck with your mod! :smile: Edited for typos. Edited January 14, 2020 by StormWolf01 Link to comment Share on other sites More sharing options...
Hoamaii Posted January 14, 2020 Share Posted January 14, 2020 Yeah, if it's for Fallout4, you need to create an InputEnableLayer variable first before you can disable controls. Would go like this: InputEnableLayer NoWeaponLayer = InputEnableLayer.Create() NoWeaponLayer.DisablePlayerControls(false, true, false, false, false, false, false) You will also need to use this variable to restore player's controls when the player exits your cell: If NoWeaponLayer NoWeaponLayer.Delete() Utility.Wait(0.1) NoWeaponLayer = None EndIf The door may not be the best object to script though as you'd need to consider both enter and exit sides of that door. If your cell has only one door, I'd suggest placing a TriggerBox around both the DoorMarker and the COCheadingMarker inside your cell instead, and add this script to it: InputEnablelayer NoWeaponLayer Auto State WaitingForPlayerToEnter Event OnTriggerEnter(ObjectReference akTriggerRef) If akTriggerRef == Game.GetPlayer() NoWeaponLayer = InputEnableLayer.Create() NoWeaponLayer.DisablePlayerControls(false, true, false, false, false, false, false) GoToState("WaitingForPlayerToExit") EndIf EndEvent EndState State WaitingForPlayerToExit Event OnCellDetach() If NoWeaponLayer NoWeaponLayer.Delete() Utility.Wait(0.1) NoWeaponLayer = None EndIf GoToState("WaitingForPlayerToEnter") EndEvent EndState Link to comment Share on other sites More sharing options...
Carreau Posted January 14, 2020 Share Posted January 14, 2020 The door would be a bad place to attach the script. Primarily because input layers automatically clean up on script destruction. It would be better to attach the script as an alias script and have the door script fill a quest alias with the player once the walk through. Then on the way back through the door, have the door clear the alias. Link to comment Share on other sites More sharing options...
Recommended Posts