So I'm trying to get it so it changes automatically so say you move your mouse then it moves, It doesn't do that it just stays still. I'm also trying to get it to change block type when it's changed,
local last = "Slab"
script.Parent.Parent.MaterialPicker.Placing.Changed:connect(function()
if script.Parent.Parent.MaterialPicker.Placing.Value then
repeat
local GetMaterial = script.Parent.Parent.Refrences:WaitForChild(currentType)
wait(.1)
--If diffrent then change block
if script.Parent.Parent.Refrences:WaitForChild(currentType).Name ~= last then
Player.Character[last].Parent = script.Parent.Parent.Refrences
last = GetMaterial
end
--
GetMaterial.Parent = Player.Character
GetMaterial.Transparency = .6
GetMaterial.BrickColor = BrickColor.new(script.Parent.Parent.MaterialPicker.Colors.CurrentColor.Value)
local material = script.Parent.Parent.MaterialPicker.MainFrame.CurrentMaterial.Value
local x = math.ceil(Mouse.Hit.p.X)-2
local z = math.ceil(Mouse.Hit.p.Z)-2
x1 = x%4
z1 = z%4
x2 = x + (4 - x1)
z2 = z + (4 - z1)
GetMaterial.CFrame = CFrame.new(x2, round(Mouse.Hit.p.Y, .2)+.3, z2)
GetMaterial.Material = Enum.Material[material]
GetMaterial.CanCollide = false
part = GetMaterial
until not script.Parent.Parent.MaterialPicker.Placing.Value
end
end)
