Before you read my question, please be aware that I'm new to scripting so try to explain it in a simple way so I can understand. So basically what I want to know is how to use the Absolute Position as an if so if the Absolute Position is something specific like 80, 800 then a function is triggered. The problem is the comma because it breaks the script. I'll put the entire Local Script below.
local Player = game.Players.LocalPlayer local GB = script.Parent local GF = script.Parent.Parent["Gift Frame"] GB.MouseButton1Click:Connect(function() if GF.AbsolutePosition == 80, 800 then GF:TweenPosition(UDim2.new(0, 80, 0, 15), "Out", "Bounce") else GF:TweenPosition(UDim2.new(0, 80, 0, 800), "Out", "Bounce") end end)
Since the property AbsolutePosition
is a Vector2
object, all you would have to do is to turn your values into Vector2
object. Here's how line 6 would now look instead:
if GF.AbsolutePosition == Vector2.new(80, 800) then