Hello, I know I made a post similar to this one, but I’m having the same problem, doing it with a tool, with the scripts you gave me, they don’t work from a tool, the part is generated in the player’s position and not in the position of the mouse.
Hey @RoboTest_Official,
Did you declare mouse as a variable in your local script? Reason why I ask this is because I
I see you go down the path to get the Mouse and connect to its event. If that local script is all you have under it, I suspect that you’re actually passing nil and the server is defaulting the part’s CFrame to CFrame.new(0,0,0) because you have not assigned mouse to anything.
-- My Version
local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent"); -- obviously our remoteEvent
local Mouse = game.Players.LocalPlayer:GetMouse(); -- I declared the variable so I can use it throughout the script
Mouse.Button1Down:Connect(function() -- Listening to Button1Down Event
local mouseCFrame:CFrame = Mouse.Hit; -- Since we made Mouse a variable we can continue to access it without having to run :GetMouse() every time.
RemoteEvent:FireServer(mouseCFrame);
end)
I suggest you use raycasting because the :GetMouse() is faulty and doesn’t work really well when u place. I’ve made a thread where u can add your own building objects you can look at it here. And if u use my open-source building system then there can be simple changes to make it compatible with models. If u do use It u can use :MoveTo() rather than .Position. If u need any more help just reply.