Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CREATE A VALUE --
- local val = Instance.new("BoolValue")
- val.Name = "DESTROY?"
- val.Parent = workspace
- -- SET VALUE --
- workspace["DESTROY?"].Value = true
- workspace["DESTROY?"].Value = false
- -- CLICK EVENT --
- mouse = game.Players.LocalPlayer:GetMouse()
- mouse.Button1Down:Connect(function()
- local target = mouse.Target
- local val = workspace:FindFirstChild("DESTROY?")
- if target and val.Value == true then
- target:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement