Okay here is an example to expand on the question. The player moves their mouse over a parta, but then moves it to partb. How would I keep parta as a viable when the player changes their target?
Right now this is my script which isn't working at all
mouse.Move:Connect(function()
if placing then
if plr:FindFirstChild("ObjTarget") == nil then
objTarg = Instance.new("ObjectValue")
objTarg.Value = nil
objTarg.Name = "ObjTarget"
objTarg.Parent = plr
end
wait()
local mseX = mouse.Hit.X
local mseY = mouse.Hit.Y
local mseTarget = mouse.Target
if mseTarget then
for i,v in pairs (tycoon) do
if v == mseTarget then
unitTarget = v
objTarg.Value = unitTarget
end
end
objTarg.Changed:connect(function()
previousTarget = mseTarget
print(previousTarget)
end)
end
end
end)
I am pretty sure I didn't even get close to that script but I have been stumped for the past hour and I'm finally just going to ask.

1 comment
do you know what your comparing a variable to a variable when you could be using the variable itself...