I was trying to use a custom keybind from a textbox in my gui and whenever I die, it says that it's Parent (An ImageLabel) is a nil value. I don't know why this is happening.
My code:
1 | local g; |
2 | g = game:GetService( "UserInputService" ).InputBegan:Connect( function (input, gameProcessed) |
3 | -- Line below errors -- |
4 | if Spells.Freeze.Bind.Text:len() = = 1 or Spells.Explosion.Bind.Text:len() = = 1 then |
5 | if input.KeyCode = = Enum.KeyCode [ Spells.Freeze.Bind.Text:upper() ] then |
6 | -- Code here |
7 | end |
8 | end |
9 | end ) |