There is a folder in the Character named LocalConditions with 2 BoolValues, Forward and Back. Forward is supposed to be set to true when W is being held and set to False when let go, neither values get set to true or change, any help?
Edit: There are no errors in output
01 | local Player = game.Players.LocalPlayer |
02 | local Char = Player.Character |
03 | local uis = game:GetService( "UserInputService" ) |
04 | uis.InputBegan:connect( function (input) |
05 | if input.KeyCode = = Enum.KeyCode.W then |
06 | Char [ "LocalConditions" ] :FindFirstChild( "Forward" ).Value = true |
07 | elseif input.KeyCode = = Enum.KeyCode.S then |
08 | Char [ "LocalConditions" ] :FindFirstChild( "Back" ).Value = true |
09 | end |
10 | end ) |
11 | uis.InputEnded:connect( function (input) |
12 | if input.KeyCode = = Enum.KeyCode.W then |
13 | Char [ "LocalConditions" ] :FindFirstChild( "Forward" ).Value = false |
14 | elseif input.KeyCode = = Enum.KeyCode.S then |
15 | Char [ "LocalConditions" ] :FindFirstChild( "Back" ).Value = false |
16 | end |
17 | end ) |
How does this not work?
I tried it myself and It works just fine...
(gif): https://gyazo.com/0004e855d591856a00144ccda2d80010
Are you sure your LocalScript is located in StarterPlayerScripts?
And btw keep in mind changing these values with a LocalScript
won't replicate to the server
, only will change for the client
.