local player = game.Players.LocalPlayer local Mouse = player:GetMouse() local Mirror = game.Workspace:WaitForChild('Mirror') local MirrorGui = player.PlayerGui.MirrorGui local GuiLabel = MirrorGui.TextLabel checker = 0 game:GetService('RunService').RenderStepped:Connect(function() local X = Mouse.X local Y = Mouse.Y if Mouse.Target and Mouse.Target.Name == 'Mirror' then MirrorGui.Enabled = true GuiLabel.Position = UDim2.new(0,X,0,Y) Mouse.Button1Down:Connect(function() script.Disabled = true wait(.01) script.Disabled = false if checker == 0 then wait(.01) print('yes') checker = 1 elseif checker == 1 then wait(.01) print('no') checker = 0 end end) else MirrorGui.Enabled = false end end)
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() local Mirror = game.Workspace:WaitForChild('Mirror') local MirrorGui = player.PlayerGui.MirrorGui local GuiLabel = MirrorGui.TextLabel checker = false game:GetService('RunService').RenderStepped:Connect(function() local X = Mouse.X local Y = Mouse.Y if Mouse.Target and Mouse.Target.Name == 'Mirror' then MirrorGui.Enabled = true GuiLabel.Position = UDim2.new(0,X,0,Y) Mouse.Button1Down:Connect(function() script.Disabled = true wait(.01) script.Disabled = false if checker == false then wait(.01) print('yes') checker = true elseif checker == true then wait(.01) print('no') checker = false end end) else MirrorGui.Enabled = false end end)
I had to move my onClick function outside the render function so the number of instances produced returned to normal.