local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local Button = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteFolder = ReplicatedStorage:WaitForChild("Remotes")
local EnemyFolder = ReplicatedStorage:WaitForChild("Enemies")
local Remote = RemoteFolder:WaitForChild("Remote1")
local Fire = EnemyFolder:WaitForChild("Fire")
Button.MouseButton1Down:Connect(function(x, y)
local Clone = Fire:Clone()
Clone.Parent = workspace
while true do
wait()
local X = Mouse.Hit.Position.X
local Y = Mouse.Hit.Position.Y
local Z = Mouse.Hit.Position.Z
local NX = math.floor(X)
local NZ = math.floor(Z)
Mouse.TargetFilter = Clone
Clone.CFrame = CFrame.new(Mouse.Hit.Position)
Clone.CFrame = CFrame.new(math.floor(NX/1), 1, math.floor(NZ/1))
end
end)
This grid system idk how it works but it moves a block one stud at a time, I want it to move by two studs but idk how i would approach that problem. Iām really confused by the formulas and stuff too