#i need help badly

1 messages · Page 1 of 1 (latest)

shadow wagon
#

why wont my script work? local MarketplaceService = game:GetService("MarketplaceService")
local TweenService = game:GetService("TweenService")

local AdTemplate = script.Parent:WaitForChild("AdTemplate")
local adSize = AdTemplate.Size
local adSizeIn = adSize - UDim2.fromOffset(60, 40)
local outPos = AdTemplate.Position
local poptime = .25

--// Ads
local SHOWTIME = 10
local FIRST_DELAY = 1

local ads = {
1290510557,
1290664561,
1290698384,
}

local function BtnAnimations(btn)
local btnSize = btn.Size
local btnOutSize = btnSize = UDim2.fromOffset(20,10)
local btnInSize = btnSize - UDim2.fromOffset(20,20)
btn.MouseEnter:Connect(function()
btn:TweenSize(btnOutSize, Enum.EasingDirection.Out, Enum.EasingStyle.Back, poptime, false)
end)
btn.MouseButtonClick:Connect(function()
btn:TweenSize(btnInSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, poptime, true)
end)
btn.MouseLeave:Connect(function()
btn:TweenSize(btnSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, poptime, true)
end)
end

BtnAnimations(AdTemplate.Buttons:WaitForChild("BuyButton"))
BtnAnimations(AdTemplate.Buttons:WaitForChild("CancelButton"))

#

this script wont work, im trying to make a gamepass popup gui by a roblox dev youtuber called CozyCoin.

heady elk
#

local MarketplaceService = game:GetService("MarketplaceService")
local TweenService = game:GetService("TweenService")

local AdTemplate = script.Parent:WaitForChild("AdTemplate")
local adSize = AdTemplate.Size
local adSizeIn = adSize - UDim2.fromOffset(60, 40)
local outPos = AdTemplate.Position
local poptime = 0.25

--// Ads
local SHOWTIME = 10
local FIRST_DELAY = 1

local ads = {
1290510557,
1290664561,
1290698384,
}

local function BtnAnimations(btn)
local btnSize = btn.Size
local btnOutSize = UDim2.fromOffset(20, 10)
local btnInSize = btnOutSize - UDim2.fromOffset(20, 20)

btn.MouseEnter:Connect(function()
    btn:TweenSize(btnOutSize, Enum.EasingDirection.Out, Enum.EasingStyle.Back, poptime, false)
end)

btn.MouseButton1Click:Connect(function()
    btn:TweenSize(btnInSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, poptime, true)
end)

btn.MouseLeave:Connect(function()
    btn:TweenSize(btnSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, poptime, true)
end)

end

-- Assuming hierarchy is correct
BtnAnimations(AdTemplate.Buttons:WaitForChild("BuyButton"))
BtnAnimations(AdTemplate.Buttons:WaitForChild("CancelButton"))