I was looking to make a ghost part before building it so I could preview where it was placing the model down.
Could this work?
bin = script.Parent
shelter = game.ServerStorage.Shelter
amt = bin:FindFirstChild("Amount")
function onButton1Down(mouse)
local model = shelter:clone()
model.Parent = game.Workspace
model:MakeJoints()
model:MoveTo(mouse.hit.p)
amt.Value=amt.Value-1
if amt.Value==0 then
bin:Destroy()
end
end
function onSelected(mouse)
local ghost = shelter:clone()
ghost.Parent = game.Workspace.CurrentCamera
ghost:MakeJoints()
ghost.Position = mouse.p -- help me with this part datastore i want it to follow mouse
for _, sd in pairs(ghost:GetChildren())
if ghost:IsA("Part") then
ghost.Transparency=0.6
ghost.BrickColor=BrickColor.new("Bright green")
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected)
|