Why this not working? Whether it is because there are 2 functions?

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local touchingparts = workspace.Team1Miejsce.Part

mouse.Button1Up:Connect(function()
	local partt = Instance.new("Part")
	partt.Size = Vector3.new(2,2,2)
	partt.Anchored = true
	partt.Material = "Wood"
	partt.Name = "PlayerBuildBlock"
	partt.BrickColor = BrickColor.new("Bright blue")
	partt.Position = mouse.Hit.Position
	partt.Parent = workspace
	touchingparts.Touched:Connect(function(hit)
		if hit.Name ~= part.Name then
			partt = nil
			end
		end)
	end		
end)

1 comment

0

on line 15 do you mean part or partt because i think you need to change that and for line 16 you can't make an part to nil you have to use partt:Destroy()