This Udim2 script is meant to position a script off the screen so it gives the play more
room to play the game while still being visible where the player can grab the Gui with their cursor and reposition it themselves.
The script works correctly the first time but resets it position back to (0.5, 0, 0.5, 0)
when the button is clicked again.
I attempted to debug the code by adding an if statement to remove the repositioning bug so if its already off screen then it just goes back to the middle of the screen. Knowing my luck and skill of code, this did not work.
If anyone could help me out then it would be greatly appreaciated!
local Button = script.Parent
local PlayerGui = game.Players.LocalPlayer.PlayerGui
Button.MouseButton1Down:Connect(function()
if PlayerGui.MacScreen.Main.Position == (1.2, 1.29) then
PlayerGui.MacScreen.Main.Position = UDim2.new(0.5, 0, 0.5, 0)
else
PlayerGui.MacScreen.Main.Position = UDim2.new(1.2, 0, 1.29, 0)
end
end)
-- Was also wondering if they completely removed the Gui Emulator from studio?