Why is it not going to the position i put it at?

I’m trying to make a plugin but the frame isnt going to the position I put it at in the script.

Heres the Script

local toolbar = plugin:CreateToolbar("BetterGui")
local newScriptButton = toolbar:CreateButton("Create Gui", "Creates a better gui and more stunning one", "rbxassetid://8491740738")





-- BetterGui
newScriptButton.Click:Connect(function()
	local newgui = Instance.new("ScreenGui")
	newgui.Name = "BetterGui"
	newgui.Enabled = true
	newgui.IgnoreGuiInset = true
	newgui.Parent = game:GetService("StarterGui")

	local newFrame = Instance.new("Frame")
	newFrame.Name = "Background"
	newFrame.Parent = newgui
	newFrame.Visible = true
	newFrame.Size = UDim2.new(0, 727, 0, 471); -- modify these to what you like
	newFrame.Position = UDim2.new(0.5, 0, newFrame.AbsolutePosition.X, 0.499, 0, newFrame.AbsolutePosition.Y)

end)




Would you please check your position UDim2 as it looks like you have too many arguments to the api.

1 Like