Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plr = game:service("Players").LocalPlayer
- hum = plr.Character.HumanoidRootPart
- mouse = plr:GetMouse()
- tool = Instance.new("Tool", plr.Backpack)
- tool.Name = "collision off"
- tool.RequiresHandle = false
- type = false
- selected = Instance.new("SelectionBox", tool)
- selected.Adornee = nil
- selected.LineThickness = 0.5
- selected.Color3 = Color3.new(1, 1, 1)
- tool.Activated:connect(function()
- local f = selected.Adornee
- if f then
- if type == false then
- f.CanCollide = false
- else
- f.CanCollide = true
- end
- end
- end)
- mouse.KeyDown:connect(function(key)
- if key == "e" then
- if type == true then
- type = false
- else
- type = true
- end
- end
- end)
- game:service("RunService").RenderStepped:connect(function()
- if type == false then
- tool.Name = "collision off"
- else
- tool.Name = "collision on"
- end
- if mouse.Target then
- selected.Adornee = mouse.Target
- else
- selected.Adornee = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement