I tried to do a block that moves when i click somewhere. When i click, a block appears, but in the 0, 0, 0 position..
The code
local PL = game.Players.LocalPlayer local MS = PL:GetMouse() local RC = game.ServerStorage.Used_Parts.MovableRedCube function Move() local RB = RC:Clone() RB.Position = Vector3.new(MS.Hit) RB.Parent = workspace end MS.Button1Up:connect(Move)
First off if this is in a Local Script (which it should be) this will not work on servers. So you should move the MovableRedCube to replicated storage or something else. Anyways try this:
local PL = game.Players.LocalPlayer local MS = PL:GetMouse() local RC = game.ReplicatedStorage.Used_Parts.MovableRedCube function Move() local RB = RC:Clone() RB.Parent = workspace RB.CFrame = CFrame.new(MS.Hit.p) end MS.Button1Up:connect(Move)