Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

mouse.Target sending mesh to workspace fix?

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)

1 comment

0

Can we see the other script, the server script?

1 answer

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.

1 comment

0

Ye

This discussion is preserved as it was. New answers, comments, and votes are closed.