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

How to make lasso stay for 5 seconds?

Asked by 10 years ago

So i been working with this script:

local deb = false
local plr = game.Players.LocalPlayer
local sb = Instance.new("SelectionBox")
local spl = Instance.new("SelectionPartLasso")

script.Parent.Selected:connect(function(mouse)
if mouse == nil then return end
sb.Color = BrickColor.new("Bright red") spl.Color = BrickColor.new("Bright red")
mouse.Button1Down:connect(function()
if mouse.Target and mouse.Target:IsA("BasePart") and not mouse.Target.Locked then
if deb == false then
deb = true
local e = Instance.new("Explosion", game.Workspace) e.BlastPressure = 0 e.BlastRadius = 3 e.Position = mouse.Target.Position
mouse.Target:Destroy()
sb.Adornee = nil sb.Parent = nil spl.Part = nil spl.Humanoid = nil spl.Parent = nil
wait()
deb = false
end
end
end)
mouse.Move:connect(function()
if mouse.Target and mouse.Target:IsA("BasePart") and not mouse.Target.Locked then
sb.Adornee = mouse.Target
spl.Part = mouse.Target
if plr.Character and plr.Character:findFirstChild("Humanoid") then spl.Humanoid = plr.Character.Humanoid spl.Parent = plr.Character sb.Parent = plr.Character end
else
sb.Adornee = nil sb.Parent = nil spl.Part = nil spl.Humanoid = nil spl.Parent = nil
end
end)
end)

script.Parent.Deselected:connect(function()
sb.Adornee = nil sb.Parent = nil spl.Part = nil spl.Humanoid = nil spl.Parent = nil
end)

I am trying to make it so the lasso (the line that connects the player to the block) stays 5 seconds after they click, i've tried the wait(5) but doesn't work.... Please help?

1 answer

Log in to vote
-1
Answered by 10 years ago

Why don't you use wait(3)?

0
I've tried a wait statement, it breaks the tool and doesn't delete. I just need to know where to place the wait timer. TwoSlhue 5 — 10y
Ad

Answer this question