Basically I'm trying to create a system where you click the part named "part" and then it clones to your mouse e.g mouse position - and then you can place it onto a certain block and then detach it from your mouse.
No errors in output whatsoever I just need help with figuring this out - thanks! - If you can help and not down-vote because of some horrid reason.
It works and function via HopperBin not a tool - but if you want to help and re-script it to work with a normal tool, you can.
Entirely your choice.
Basically I just want to make it where you click a "part" like a patty and then you can place it firmly onto a grill - that's an example description.
Here's the code so far:
local sp = script.Parent
local players = game:GetService("Players")
local player = players.LocalPlayer
local part = script:WaitForChild("part")
part.Parent = game:GetService("Workspace").CurrentCamera
sp.Selected:connect(function(mouse)
mouse.TargetFilter = part
mouse.Move:connect(function()
if mouse.Hit ~= nil then
part.Transparency = .5
part.Position = mouse.Hit.p
part.Rotation = Vector3.new(0, 0, 0)
end
end)
mouse.Button1Down:connect(function()
local hit = mouse.Target
if hit ~= nil then
if hit.Name == "Build" then
local pc = part:Clone()
pc.Parent = game:GetService("Workspace")
pc.Anchored = true
pc.Position = hit.Position + Vector3.new(0, hit.Size.Y / 2, 0)
pc.Transparency = 0
end
end
end)
end)

7 comments
Whats the problem exactly here?
I'm trying to make it where you click a part - but I can't figure it out - I just need some help on how to do it.
But what's the problem with the script
Got skype or accept my fr on ROBLOX so I can message you?
There's no problem I want help on HOW to do it.
If there's no problem with your code then it must work. ok good job.
Oh my god, I said I want HELP with the above question - read..