I was trying to make a gui where you let go of the button to stop the tween on a certain position. to have a higher chance to get something. But I get an error “attempt to compare UDim” or “attempt to compare UDim2”.
-- Local script
-- the script's parent is the screen gui.
local moveframe = script.Parent.Border.ShotMeter.Target.Mover
local borderup = script.Parent.Border.ShotMeter.Target.BorderTagUp
local borderdown = script.Parent.Border.ShotMeter.Target.BorderTagDown
PauseShot.OnClientEvent:Connect(function(player)
createanim:Cancel()
-- where the error occurs with both UDim and UDim2.
if moveframe.Position.Y <= borderup.Position.Y and moveframe.Position.Y >= borderdown.Position.Y then
print("!!green!!")
end
wait(0.4)
moveframe.Position = UDim2.new(0.469,0 ,2.475, 0)
end)
Well my guess is that u cant compare Udim2 value as an int value. I would try to compare it like that: frame. Poition. Y. Offset (or Scale, idk what are u using). And then u have two int values to compare