Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Make A Function Restart After mouse.Target Changed?

Asked by
crueluu 169
5 years ago

How Do I Make A Certain Function Reset Before Finishing After The Mouse.Target Has Changed? Heres The Script Just Incase:

01local replicatedstorage = game:GetService("ReplicatedStorage")
02 
03                 local run = game:GetService("RunService")
04  local Player = game.Players.LocalPlayer
05                                        local mouse = Player:GetMouse()
06          local billBG = replicatedstorage:WaitForChild("BlockTag")
07                                                                     local down
08 
09run.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!")
14        else
15                billBG.Parent = replicatedstorage
View all 51 lines...

Answer this question