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

My build tool won't work?

Asked by
Mr1Vgy 30
10 years ago

I've tried and tried and I can't figure out why this won't place a part in the workspace at the position of the mouse. Can anyone help?

plr = game.Players.LocalPlayer
local part = game.Lighting.BuildObjects:FindFirstChild(script.Parent.itemName.Value)
        if part and not game.Workspace:FindFirstChild("transPart"..plr.Name)then
            local transPart = part:Clone()
            transPart.Name = "transPart"..plr.Name
            for i, v in pairs(transPart:GetChildren())do
                v.Transparency = .5
                v.CanCollide = false
            end
            transPart.Parent = game.Workspace
            while true do
                wait(.01)
                local m = plr:GetMouse()
                if m.Target == nil then return end
                transPart:MoveTo(Vector3.new(m.Origin))


            end
        end

Answer this question