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