How To Make A Function Restart After mouse.Target Changed?
How Do I Make A Certain Function Reset Before Finishing After The Mouse.Target
Has Changed?
Heres The Script Just Incase:
01 | local replicatedstorage = game:GetService( "ReplicatedStorage" ) |
03 | local run = game:GetService( "RunService" ) |
04 | local Player = game.Players.LocalPlayer |
05 | local mouse = Player:GetMouse() |
06 | local billBG = replicatedstorage:WaitForChild( "BlockTag" ) |
09 | run.RenderStepped:Connect( function () |
10 | if mouse.Target ~ = nil then |
11 | if mouse.Target.Parent = = game.Workspace.Blocks then |
12 | billBG.Parent = mouse.Target |
13 | print ( "BlockHoveredOn!" ) |
15 | billBG.Parent = replicatedstorage |
16 | print ( "No Destroy-Able Blocks Found" ) |
21 | mouse.Button 1 Down:Connect( function () |
24 | for _,child in pairs (billBG:GetChildren()) do |
32 | mouse.Button 1 Up:Connect( function () |
35 | for _,child in pairs (billBG:GetChildren()) do |
46 | if mouse.Target.Parent = = game.Workspace.Blocks then |
48 | mouse.Target:Destroy() |