UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
print("ran")
if isLockOnEnabled == false then
isLockOnEnabled = true
local hint = script.Hint:Clone()
hint.Text = "Aimlock has been enabled."
hint.Parent = player.PlayerGui.Hints.Frame
wait(2)
ts:Create(hint,info,{ TextTransparency = 1 }):Play()
wait(1)
hint:Destroy()
elseif isLockOnEnabled == true then
isLockOnEnabled = false
lockOn = nil
local hint = script.Hint:Clone()
hint.Text = "Aimlock has been disabled."
hint.Parent = player.PlayerGui.Hints.Frame
wait(2)
ts:Create(hint,info,{ TextTransparency = 1 }):Play()
wait(1)
hint:Destroy()
end
end
end)
why does this run twice on one key press?
i have another script nearly identical to this but it doesn't run into this problem
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and not Chatting() then
if esp == false then
esp = true
local hint = script.Hint:Clone()
hint.Text = "ESP has been enabled."
hint.Parent = plr.PlayerGui.Hints.Frame
wait(2)
ts:Create(hint,info,{ TextTransparency = 1 }):Play()
wait(1)
hint:Destroy()
else
esp = false
local hint = script.Hint:Clone()
hint.Text = "ESP has been disabled."
hint.Parent = plr.PlayerGui.Hints.Frame
wait(2)
ts:Create(hint,info,{ TextTransparency = 1 }):Play()
wait(1)
hint:Destroy()
end
end
end)