Frame won’t go up and text won’t go up then both back down.
local button = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character:WaitForChild("Humanoid")
local leaderstats1 = player:WaitForChild("leaderstats"):WaitForChild("EggCoins")
local leaderstats2 = game.ReplicatedStorage.w1
local button2 = script.Parent.Parent.Parent.Three.TextLabel
local three = script.Parent.Parent
local four = script.Parent.Parent.Parent.Three.TextLabel
local originalposition = script.Parent.Parent.Position
local MaxEggdog = 1
local trigger = game.ReplicatedStorage:WaitForChild("TropicalEggdog")
if MaxEggdog > 1 then
four.Text = "You can't buy more than one skin!"
--copy tween service here
end
button.MouseButton1Click:Connect(function()
if leaderstats1.Value >= 150 then
--[[leaderstats2.Value = true
button.Sound:Play()
leaderstats.Value -= 150
trigger:FireServer()
MaxEggdog += 1
script.Parent.Parent.Parent.Enabled = false ]]
button.Sound:Play()
local Info = TweenInfo.new(1.25, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out)
local ts = game:GetService("TweenService")
local db = false
local tween4 = ts:Create(three, Info, {
["Position"] = originalposition + UDim2.fromScale(0, -0.2)
})
local tween5 = ts:Create(four, Info, {
["Position"] = UDim2.fromScale(0.25, 0.85) --1.5 later
})
if not db then
db = true
tween4:Play()
tween5:Play()
wait(3.5)
local tween6 = ts:Create(three, Info, {
["Position"] = originalposition - UDim2.fromScale(0, -0.2)
})
local tween7 = ts:Create(four, Info, {
["Position"] = UDim2.fromScale(0.25, 1.5)
})
tween6:Play()
tween7:Play()
db = false
end
end
end)
local button = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character:WaitForChild("Humanoid")
local leaderstats1 = player:WaitForChild("leaderstats"):WaitForChild("EggCoins")
local leaderstats2 = game.ReplicatedStorage.w1
local button2 = script.Parent.Parent.Parent.Three.TextLabel
local three = script.Parent.Parent
local four = script.Parent.Parent.Parent.Three.TextLabel
local originalposition = script.Parent.Parent.Position
local MaxEggdog = 1
local trigger = game.ReplicatedStorage:WaitForChild("TropicalEggdog")
if MaxEggdog > 1 then
four.Text = "You can't buy more than one skin!"
--copy tween service here
end
button.MouseButton1Click:Connect(function()
if leaderstats1.Value >= 150 then
--[[leaderstats2.Value = true
button.Sound:Play()
leaderstats.Value -= 150
trigger:FireServer()
MaxEggdog += 1
script.Parent.Parent.Parent.Enabled = false ]]
button.Sound:Play()
local Info = TweenInfo.new(1.25, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out)
local ts = game:GetService("TweenService")
local db = false
if not db then
db = true
three:TweenSizeAndPosition(
UDim2.new(0.9, 0,0.9, 0), -- size
UDim2.new(0.07, 0,-0.1, 0), -- pos
Enum.EasingDirection.Out, --easing dir
Enum.EasingStyle.Sine, --easing styl
1.25,
true
)
four:TweenPosition(
UDim2.new(0.25, 0,0.85, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Sine,
1.25,
true
)
wait(3.5)
three:TweenSizeAndPosition(
UDim2.new(1, 0,1, 0), -- size
UDim2.new(0, 0,0, 0), -- pos
Enum.EasingDirection.Out, --easing dir
Enum.EasingStyle.Sine, --easing styl
1.25,
true
)
four:TweenPosition(
UDim2.new(0.25, 0,1.5, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Sine,
1.25,
true
)
db = false
end
end
end)
Alright so I suggest that you put prints basically everywhere (mainly per if statement), give them specific names with or without numbers. Then check which work and which dont.
Then after you’ll notice what does not work, put more if statements there.
Quick side note, you have to move
local db = false
Above the button.mouseButton1Click function, because well that will happen is every time you click it’ll be automatically set to db = false, so there is no cooldown first of all.