So, I'm making a tycoon with a custom inventory. It has a button which gives you a tool to place a mine. The only problem is that you can place it anywhere you want in the game, and I want it to only be place-able on a baseplate. How can I do this?
Placing Script: (located inside a tool, and yes THE SCRIPT WORKS)
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:connect(function()
local pos = mouse.hit.p
local mine = script.Parent.StoneMine:Clone()
mine.Parent = game.Workspace
mine:MoveTo(pos)
script.Parent:Destroy()
for i,v in pairs(mine:GetChildren())do
if v.ClassName == "Part" and v.Name ~= "Dropper" then
v.Transparency = 0
v.CanCollide = true
v.Parent.Dropper.Transparency = 0.3
v.Parent.Configuration.IsActive.Value = true
end
end
end)
