I’m trying to make it so that once the button is pressed, it “enables” the InputBegan function to check if the player clicked, if so then end the function. However, the function still fires and I’m confused why that is?
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local object = Player.PlayerGui.Build.BackFrame.MainFrame.BuildScroll.Armor1.Object
local button = object.Button.Activated:Connect(function()
local click = UserInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print("Clicked")
end
end)
local Update = RunService.RenderStepped:Connect(function()
end)
object.Button.Activated:Connect(function()
Update:Disconnect()
end)
end)