Controls:Enable() Problem (UNSOLVED)

I am working on a videogame where you craft stuff and finally got the keybind problem working, (if -wondering how to trigger gui with a keybind refer to my previous posts)

But the problem is that I Disable player controls once you go in inventory, you can’t enable them back from the current programming

local Player = Players.LocalPlayer
local PlayerModule = require(Player.PlayerScripts.PlayerModule)
local Controls = PlayerModule:GetControls()
local plr = game.Players.LocalPlayer

plr:GetMouse().KeyDown:Connect(function(key)
	if key == "e" then
		Controls:Disable()
		script.Parent.Enabled = not script.Parent.Enabled -- Problem!!
	end
end)

Problem is, the part: script.Parent.Enabled = not script.Parent.Enabled
when I try to add Controls:Enable(true) It makes it stop working, goal is to make it to where when I click e again to remove gui from screen it simply doesn’t enable or is always enabled

2 Likes

You can only use “not” in conditional statements (if then). Do script.Disabled = true instead

False, you can 100% use not in this case, try print(not true) in the command bar and it will print false.

2 Likes

what do you mean print not true?

Ok I guess that’s true, but Script.Enabled does not exist, you have to use script.Disabled