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

Brick not appearing in Play mode?

Asked by
NotSoNorm 777 Moderation Voter
9 years ago

This is a normal script inside of ModuleScript that is inside of StarterGui

Filtering enabled is on

--Pieces
repeat wait() until script.Parent.Parent.Parent.Parent
local Player = script.Parent.Parent.Parent
local Mouse = Player:GetMouse()
local slab = script.Parent.Parent.Refrences.Slab:Clone()

Mouse.Button1Down:connect(function()
    if script.Parent.Parent.MaterialPicker.Placing.Value == true then
        wait(.1)
        local SlabClone = Player.Character.Slab:Clone()
        SlabClone.Parent = game.Workspace
        SlabClone.Transparency = 0
        SlabClone.CanCollide = true
    end
end)

while true do
    wait(.1)
    if script.Parent.Parent.MaterialPicker.Placing.Value == true then
    slab.Parent = Player.Character
--  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
    local y = math.ceil(Mouse.Hit.p.Y)-2
    x1 = x%4
    y1 = y%4
    z1 = z%4
    x2 = x + (4 - x1)
    y2 = y + (4 - y1)
    z2 = z + (4 - z1)
    slab.CFrame = CFrame.new(x2,y2,z2)
    slab.Transparency = .5
    --  slab.Material = Enum.Material.material
    slab.CanCollide = false
    else
        slab.Transparency = 1
    end
end

1 answer

Log in to vote
-1
Answered by 9 years ago

Did you anchor it? XD

0
It's a clone, not a new instance NotSoNorm 777 — 9y
Ad

Answer this question