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

This Build Tool does not work, even when equipped. WHY?!?

Ive had loads of trouble with this BuildTool and for Some reason it STILL doesn't work after posting a few times and getting answers. So here is my LocalScript, Inside my tool, which is inside starter pack. I have no idea whats wrong, I have been trying for HOURS and its not working. Can anyone help me?

local Equipped = script.Parent.Equipped
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local val

mouse.Button1Down:Connect(function()

if Equipped == true then

	local player = game.Players.LocalPlayer
	local mouse = player:GetMouse()
	local val
 
	mouse.Button1Down:connect(function()
		print("WORKING! SO FAR...")
    	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"
        	print("WORKING!")
    	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)

1 answer

Line 1 and Line 8. You are comparing an instance with a boolean. What I am assuming is that you are comparing a BooleanValue's property Value. I am thinking of

-- Line 7
if Equipped.Value==true then
	-- Code
end;

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