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

How do I fix this SelectionPointLasso problem?

Asked by
ZarceI 0
7 years ago
Edited 7 years ago

So I made a script recently. And I want to know how to fix it.

The problems are:

Once I insert it in the game, then die. It messes up. Completely. It keeps the lassos on and doesnt delete. I want to make it so it doesnt do that and I can still die in the game and it is fresh and new. (I execute in a script builder btw not a game on ROBLOX I am not cheating/exploiting)

-- Created by Zarcel

-- makes you fly or float. people wont be able to see the white lines or constraints that you see.

-- controls : E to launch flight / string Put mouse on a building or part.

-- Once you die, you will have to rejoin the game and execute the script again.[will fix in the future]

wait() Player = game.Players.LocalPlayer Character = Player.Character RightArm = Character["Right Arm"] LeftArm = Character["Left Arm"] Torso = Character.Torso Action = "RightSpin" mouse = Player:GetMouse()

--W

wait(0.5)

local player=game.Players.LocalPlayer local character=player.Character local torso=character:findFirstChild("Torso") local humanoid=character:findFirstChild("Humanoid")

lhook=nil rhook=nil

local mouse=player:GetMouse()

mouse.KeyDown:connect(function(key) if key=="e" and humanoid and mouse.Target then local sel=Instance.new("SelectionPointLasso") sel.Parent=workspace sel.Humanoid=humanoid sel.Color=BrickColor.new("White") sel.Point=mouse.Hit.p

rhook=sel local bv=Instance.new("BodyVelocity") bv.Parent=torso bv.Name="RightForce" bv.maxForce=Vector3.new(math.huge,math.huge,math.huge) bv.velocity=CFrame.new(torso.Position, mouse.Hit.p).lookVector100 elseif key=="e" and humanoid and mouse.Target~=nil then local sel=Instance.new("SelectionPointLasso") sel.Parent=workspace sel.Humanoid=humanoid sel.Color=BrickColor.new("White") sel.Point=mouse.Hit.p lhook=sel local bv=Instance.new("BodyVelocity") bv.Parent=torso bv.Name="LeftForce" bv.maxForce=Vector3.new(math.huge,math.huge,math.huge) bv.velocity=CFrame.new(torso.Position, mouse.Hit.p).lookVector100 end end)

mouse.KeyUp:connect(function(key) if key=="e" then if rhook~=nil then rhook:Destroy() if torso:findFirstChild("RightForce") then torso.RightForce:Destroy() end end elseif key=="e" then if lhook~=nil then lhook:Destroy() if torso:findFirstChild("LeftForce") then torso.LeftForce:Destroy() end end end end)

0
how to fix? ZarceI 0 — 7y

Answer this question