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

A tool that unanchors certain bricks? [closed]

Asked by 8 years ago

How would I make this?

Closed as Not Constructive by koolkid8099, YellowoTide, and M39a9am3R

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 8 years ago

This is not a request site. Either make and show or an attempt or find a better site, this is not how we do things here. Look here for reference

0
Its not a request, I'm just trying to get some tips for it because I attempted and nearly ripped out my hair in the process. Its not a request, I was just asking for some lines of text to help me out. RPDofficerbrick 0 — 8y
0
Pike Pole: if hitted:IsA("BasePart") and hitted.Name == "Glass" or hitted.Name == "Window" or hitted.Name == "DestructionPart" and hitted.Transparency > 0 then local gbs = Instance.new("Sound") gbs.SoundId = "rbxasset://sounds\\Glassbreak.wav" gbs.Volume = 0.5 gbs.Parent = hitted gbs:Play() game:GetService('Debris'):AddItem(gbs, 1) hitted:Destroy() end Battering Ram: if hitted:IsA("BasePart") a RPDofficerbrick 0 — 8y
0
If you wanted some tips you should have said that, this looks like a request so i will take it as one. koolkid8099 705 — 8y
Ad
Log in to vote
0
Answered by
Cuirs 10
8 years ago

All depends what you mean.

If you mean a tool that unanchors bricks that you click then:

script.Parent.Equipped:connect(function(Mouse)
    Mouse.Button1Down:connect(function()
        if Mouse.Target and not Mouse.Target.Locked then
            if Mouse.Target.Anchored then
                Mouse.Target.Anchored = false;
            else
                return print("Already unanchored!");
            end
        else
            return print("Part is locked");
        end
    end)
end)

That code goes inside a LocalScript inside your tool. This script was designed for the Tool object WITHOUT a Handle, but works either way. But if you mean a tool that unanchores SPECIFIC bricks, for example a door, then:

local Bricks = {
    Workspace.Part;
    Workspace.Part2;
    Workspace.Door;
}

script.Parent.Equipped:connect(function(Mouse)
    Mouse.Button1Down:connect(function()
        for _,Item in pairs(Bricks) do
            if Item.Anchored then
                Item.Anchored = false;
            else
                return print("Bricks are already unanchored!");
            end
        end
    end)
end)

NOTE: This will only work if the parts are ANCHORED.

I hope this helps. :)

0
Thank you so much that helped! RPDofficerbrick 0 — 8y