alright so in my script i have it where when a player clicks one gui it makes another visible or not visible which works fine but im wanting it to set the top left corner of the gui to where the mouse was at the time of the click which does not work ive had it going into the hundreds with position and what ive got now is the closest ive got to it working
Script:
local MainGui = script.Parent.Parent.Parent.MainFrame local PlayerOptions = MainGui.PlayerOptions local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() script.Parent.MouseButton2Click:Connect(function() PlayerOptions.Position = UDim2.new(0, Mouse.X/5.5, 0, Mouse.Y/5.5) -- the issue here PlayerOptions.Visible = not PlayerOptions.Visible end)
If you want the top left of your gui to move to where your Mouse is then you'll want to make the AnchorPoint of the gui frame to 0, 0 and then you'll just want to do
Frame.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)