Background: So I'm building a game like Clash of Clans, and I notice when I to :MoveTo(), it doesn't work. Beause I print the Vector3.new(mouse.Hit) it says 0, 0, 0.
Fail Solution: - I try doing :SetPrimaryPartCFrame(), it does weird "things".
- I also try doing
:TranslateBy(), it's an error.
local mouse = game.Players.LocalPlayer:GetMouse()
local ar = false
script.Parent.Equipped:Connect(function()
print("TRUE")
if ar ~= true then
ar = true
local f = Instance.new("Folder", workspace.PlayerBuilding)
f.Name = game.Players.LocalPlayer.Name
local w = game:GetService("Lighting").Level1Wall:Clone()
w.Parent = f
end
end)
script.Parent.Unequipped:Connect(function()
print("TRUE")
ar = false
workspace.PlayerBuilding:FindFirstChild(game.Players.LocalPlayer.Name):Destroy()
end)
while wait(0.01) do
if workspace.PlayerBuilding:FindFirstChild(game.Players.LocalPlayer.Name) then
local wa = workspace.PlayerBuilding:FindFirstChild(game.Players.LocalPlayer.Name).Level1Wall
wa:MoveTo(Vector3.new(mouse.Hit))
end
end

3 comments
Thank you for you answer! I will accept it once it work.
Alright, thanks.
Yeah it doesn't work