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

when ever i clicked on the screen it wont go to the position of the mouse?

local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local Part = game.Workspace.Baseplate

mouse.Button1Down:Connect(function(clicked) if clicked then Part.Position = Vector3.new(mouse.x,mouse.y,0)

end

end)

1 comment

0

remove clicked there is no parameter from Mouse.Button1Down

1 answer

local Player = game:GetService("Players").LocalPlayer
local Cursor = Player:GetMouse()

local Part = workspace.Part

Cursor.Button1Down:Connect(function()
    if (Cursor.Target ~= nil) then
        Part.Position = Cursor.Hit.p
    end
end)

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