Hello!(Sorry for bad english
). I’m very new to scripting. I don’t know what the problem is. Can someone take a look at my script and tell me what’s wrong. It opens fine for the first few times after that it starts glitching. Ty!
https://streamable.com/n8q3bd
local UserInputService = game:GetService("UserInputService")
local frame = script.Parent:WaitForChild("Frame")
local db = true
UserInputService.InputBegan:Connect (function(input,gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.Tab then
if db == true then
script.Parent.Frame.Visible = true
frame:TweenSizeAndPosition(
UDim2.new(0,472,0,404),
UDim2.new(0.214,0,0.155,0),
"Out",
"Elastic"
)
for i,v in pairs(script.Parent.Frame:GetChildren()) do
if v:IsA("TextButton") then
v.Visible = true
v:TweenSize(
UDim2.new(0, 141,0,88),
"Out",
"Elastic",
5
)
end
end
db =false
else
script.Parent.Frame.Visible = false
frame:TweenSizeAndPosition(
UDim2.new(0,0,0,0),
UDim2.new(0.5,0,0.5,0),
"Out",
"Elastic"
)
for i,v in pairs(script.Parent.Frame:GetChildren()) do
if v:IsA("TextButton") then
v.Visible = false
v:TweenSize(
UDim2.new(0, 0,0,0),
"Out",
"Elastic",
5
)
end
end
db =true
end
end
end
end)