Hello everyone! I’m trying to make an input key that opens a menu, and it works kinda well, but when I try to add some if condition then
the script doesn’t work, and there’s also no errors in the output. Maybe I’m missing something… heres the script:
local UIS = game:GetService("UserInputService")
local Blur = game.Lighting:WaitForChild("Blur")
UIS.InputBegan:Connect(function(InputObject, Processed)
if InputObject.KeyCode == Enum.KeyCode.M then
if IsOpen.Value == false and CanOpen.Value == true then
TS:Create(Blur, TweenInfo.new(.5), {Size = 20}):Play()
wait(.3)
TS:Create(PlayerGui.Graphics.Mission, TweenInfo.new(.25), {ImageTransparency = 0}):Play()
TS:Create(PlayerGui.Graphics.Mission, TweenInfo.new(.25), {Size = UDim2.new(0.382, 0,0.679, 0)}):Play()
print("Worked")
elseif IsOpen.Value == true and CanOpen.Value == true then
TS:Create(Blur, TweenInfo.new(.5), {Size = 0}):Play()
wait(.3)
TS:Create(PlayerGui.Graphics.Mission, TweenInfo.new(.25), {ImageTransparency = 1}):Play()
TS:Create(PlayerGui.Graphics.Mission, TweenInfo.new(.25), {Size = UDim2.new(0.382, 0,0.679, -50)}):Play()
print("Worked")
else
print("Dont")
end
end
end)
CanOpen
and IsOpen
are bool values, so I can change them outside of the script.