I know how to change a part's position based on another part's position, but I can't figure out how to check if a part is, say, three units above another one. Can anyone point me in the right direction?
EDIT: Tried this, didn't work.
Error: Workspace.number.Script:3: attempt to call field 'Position' (a userdata value)
function checkmine() local mine = game.Workspace:FindFirstChild("mine") if mine.Position == script.Parent.Position + script.Parent.Position(4,0,0) then game.ReplicatedStorage:FindFirstChild("1"):Clone().Parent = script.Parent end end script.Parent.ClickDetector.MouseClick:connect(checkmine)
function checkmine() local mine = game.Workspace:FindFirstChild("mine") if mine.Position == script.Parent.Position + Vector3.new(4,0,0) then game.ReplicatedStorage:FindFirstChild("1"):Clone().Parent = script.Parent end end script.Parent.ClickDetector.MouseClick:connect(checkmine)
try this?