In my script I want to have the Left Alt key change the lettering inside of a GUI. The script is a LocalScript located inside StarterPack. For some strange reason when I go to test it, the lettering doesn't change but instead says "Attempt to change a nil value" As you can see I'll be adding more code below that will change the leg used. I haven't added that code yet due to the fact that this simple thing isn't working, it's verryyy frustrating. Thanks for your help! EDIT: I have tested it with a different button than LeftAlt and still yields the same result.
CF = game.StarterGui.ChooseFoot.Frame.TextLabel
game:GetService("UserInputService").InputBegan:connect(Pressed)
function Pressed(key)
if key == Enum.KeyCode.LeftAlt then
if CF.Text == "R" then
CF.Text = "L"
elseif CF.Text == "L" then
CF.Text = "R"
end
end
end

1 comment
It didn't yield "attempt to call an nil value" but it still didn't change the Text in the GUI. The GUI path goes: game.StarterGui.ChooseFoot.Frame.TextLabel.Text Thanks for the help too, you've answered a similar question of mine regarding the use of left alt :)