Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

This time my build script will not work wether your holding it or not!?

So I have a tool called buildtool with this script inside it: But its not working!?

mouse.Button1Down:Connect(function()

    if Equipped == true then

        local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local val
 
mouse.Button1Down:connect(function()
    if mouse.Target and mouse.Target.Name ~= "Baseplate" then
        local block = Instance.new("Part", workspace) -- new Block
        block.Anchored = true
        block.Size = Vector3.new(5,5,5) -- block size
        block.BrickColor = BrickColor.White()
        block.Name = "TempBlock"
    end
end)
 
mouse.Button1Up:connect(function()
    if mouse.Target and mouse.Target.Name ~= "Baseplate" then
        local foundBlock = workspace:FindFirstChild("TempBlock")
        foundBlock.CFrame = CFrame.new(mouse.Target.Position) + Vector3.new(0,5,0)
        foundBlock.Name = "PlacedBlock"
    end
end)
 
mouse.KeyUp:connect(function(k)
    local key = k:lower()
    if key == "r" then
        if mouse.Target.Name == "PlacedBlock" then
            mouse.Target:Destroy()
        end
    end
end)

    end

end)

2 comments

0

Do you have any extra code above the lines? There may be a yielding issue then, if not check your output, else use print debugging: https://www.youtube.com/watch?v=JpeE1RxNVho

0

I dont have any other code above these lines :(

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.