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

mouse.Target sending mesh to workspace fix?

Asked by
1envo 0
4 years ago

Well i am making a script where when i click on something it sends a mesh to the target of the mouse , But it seems to send it to workspace any fixes?

local mouse = MainUserP:GetMouse()
mouse.Button1Down:Connect(function()
    if MainUserW:FindFirstChild("PompousTheCloud") then
            if mouse.Target and mouse.Target.Parent then
                local place = mouse.Target.Parent
                game.workspace.GuiEvent:FireServer(".")
                wait(0.4)
                game.Players.LocalPlayer.Character.Mesh.Parent = place
                wait(0.4)
                game.workspace.GuiEvent:FireServer(".")
            end
    end
end)
0
Can we see the other script, the server script? JayShepherdMD 147 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You're setting the variable place to the parent of mouse.Target. If the parent of mouse.Target is workspace the mesh will be sent there.

Just make place on line 5 mouse.Target and the mesh's parent will be transported directly into mouse.Target.

0
Ye VitroxVox 884 — 4y
Ad

Answer this question