Scale not working

im making animation gui gampass and when i open and close the scale is not workng well and the position change. please help me i tried everything.


local GamepassId = 21177189 -- example

local frameToShow = script.Parent -- example

local player = game.Players.LocalPlayer
repeat wait() until player.Character -- waits for player to load in

local PlayerGui = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui")
-- quote me if im wrong, but that should work

local MarketplaceService = game:GetService("MarketplaceService")
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamepassId) then
	frameToShow.Visible = true

local button = script.Parent
local frame = script.Parent.Parent.AnimationsBG
local debounce = false



	if debounce == false then
		debounce = true

		frame.Visible = true

	elseif debounce == true then
		debounce = false

		frame.Visible = false


animation gui model: Animation Gui - Roblox

Well first of we don’t know what the scale is by scale do you mean the gui’s scale size? Or some sort of function you created yourself?

As for the position, do you mean to place the gui directly below the button or somewhere else?

If you could provide exactly what you’re trying to achieve here I might be able to offer some more advanced help.


change this to

repeat game:GetService("RunService").Heartbeat:Wait() until player.Character

or just change it to this more cannon version.

local Character = player.Character or player.CharacterAdded:Wait()

wait() has a load of problems of itself if you use it so it’s better to just replace it with RunService.Heartbeat.