What actually happens when you reference an ObjectValue's value?
I am getting the error:
Workspace.SteamG0D.ControlScript:14: attempt to index upvalue 'V' (a nil value)
What I am trying to do is have a script give assign it's parent to the value of an ObjectValue, which does work, and then once that happens, another script (a local script inside the player character) applies actions to the parts inside the ObjectValue's referenced object.
01 | local uis = game:GetService( "UserInputService" ) |
02 | local player = script.Parent |
03 | local V = player.Obj.Value |
06 | uis.InputBegan:Connect( function (Input, IsTyping) |
07 | if Input.KeyCode = = Enum.KeyCode.Y and not IsTyping then |
09 | print ( "Y has been pressed OFF" ) |
10 | V.Base.BodyForce.Force.Y = 0 |
12 | print ( "Y has been pressed ON" ) |
13 | V.Base.BodyForce.Force.Y = workspace.Gravity |