01 | local player = game.Players.LocalPlayer |
02 | local Mouse = player:GetMouse() |
03 | local Mirror = game.Workspace:WaitForChild( 'Mirror' ) |
04 | local MirrorGui = player.PlayerGui.MirrorGui |
05 | local GuiLabel = MirrorGui.TextLabel |
06 | checker = 0 |
07 |
08 | game:GetService( 'RunService' ).RenderStepped:Connect( function () |
09 | local X = Mouse.X |
10 | local Y = Mouse.Y |
11 |
12 | if Mouse.Target and Mouse.Target.Name = = 'Mirror' then |
13 | MirrorGui.Enabled = true |
14 | GuiLabel.Position = UDim 2. new( 0 ,X, 0 ,Y) |
15 | Mouse.Button 1 Down:Connect( function () |
01 | local player = game.Players.LocalPlayer |
02 | local Mouse = player:GetMouse() |
03 | local Mirror = game.Workspace:WaitForChild( 'Mirror' ) |
04 | local MirrorGui = player.PlayerGui.MirrorGui |
05 | local GuiLabel = MirrorGui.TextLabel |
06 | checker = false |
07 |
08 | game:GetService( 'RunService' ).RenderStepped:Connect( function () |
09 | local X = Mouse.X |
10 | local Y = Mouse.Y |
11 |
12 | if Mouse.Target and Mouse.Target.Name = = 'Mirror' then |
13 | MirrorGui.Enabled = true |
14 | GuiLabel.Position = UDim 2. new( 0 ,X, 0 ,Y) |
15 | Mouse.Button 1 Down:Connect( function () |
I had to move my onClick function outside the render function so the number of instances produced returned to normal.