Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local UIS = game:GetService('UserInputService')
- local RS = game:GetService('ReplicatedStorage')
- local tool = script.Parent
- local Event = RS:WaitForChild('DeleteBlock')
- local equipped = false
- local Box = Instance.new('SelectionBox')
- Box.Color3 = Color3.new(1,0,0)
- Box.Parent = workspace
- tool.Equipped:Connect(function()
- equipped = true
- end)
- tool.Unequipped:Connect(function()
- equipped = false
- Box.Adornee = nil
- end)
- -- Selection Box
- mouse.Move:Connect(function()
- local target = mouse.Target
- if target then
- if target.Parent.Name == player.Name and equipped then
- Box.Adornee = target
- else
- Box.Adornee = nil
- end
- end
- end)
- -- Delete Block
- script.Parent.Activated:Connect(function()
- local target = mouse.Target
- if target then
- if target.Parent.Name == player.Name then
- Event:FireServer(target)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement