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

How do i make this place model instead of parts?

Asked by 3 years ago

this is the local script

local mouse = game.Players.LocalPlayer:GetMouse()
local off = false
local plr = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local mat = Enum.Material.WoodPlanks
local color = BrickColor.new("Br. yellowish orange")
local eq = false
script.Parent.Equipped:Connect(function()
    if mouse ~= nil then
        eq = true
        local gui = script.Parent.material:Clone()
        script.Parent.UsedGui.Value = gui
        gui.Parent = plr.PlayerGui
        local clonnedbrick = game.ReplicatedStorage.Brick:Clone()
        mouse.TargetFilter = clonnedbrick
        clonnedbrick.Transparency = .5
        clonnedbrick.Parent = workspace
        while mouse ~= nil do
            clonnedbrick.Position = mouse.Hit.p + Vector3.new(0,2,0)
            clonnedbrick.Material = mat
            clonnedbrick.BrickColor = color
            wait()
            if off then
                clonnedbrick:Destroy()
                off = false
                break
            end
        end
    end
end)
script.Parent.Activated:Connect(function()

    local pos = mouse.Hit.p + Vector3.new(0,2,0)
    script.Parent.RemoteEvent:FireServer(pos,mat,color)
end)
script.Parent.Unequipped:Connect(function()
    eq = false
    off = true
    plr.PlayerGui:FindFirstChild("material"):Destroy()
end)

and this is the script

script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr,pos,mat,C)
    local brick = game.ReplicatedStorage.Brick:Clone()
    brick.Parent = workspace
    brick.CanCollide = true
    brick.Position = pos
    brick.Name = plr.Name
    brick.Material =  mat
    brick.BrickColor = C
end)

it can only place parts from replicated storage and not models how do i do that

0
Did the color work i just looked over both scripts and both questions bily117 6 — 3y

Answer this question