- What do you want to achieve?
I need help to fix my script. It is basically when a player presses M
on their keyboard a UI will pop up. But in my case, the UI does pop up, but it takes a very long time to do so. It is not instant, which I something I want it to be.
- What is the issue?
There is a very long delay, in the UIS.InputBegan
code execution.
- What solutions have you tried so far?
I’ve looked for solutions on Google. But, they did not meet my answer.
UIS.InputBegan:Connect(function(input, gameProgressed)
if gameProgressed then
return
end
if input.KeyCode == Enum.KeyCode.M then
local target = UDim2.new(0.5, 0,0.5, 0) -- Main Panel Position
-- Intro Text & Image Configs
local ti = TweenInfo.new(
1.5,
Enum.EasingStyle.Exponential,
Enum.EasingDirection.Out,
0,
false,
1.5)
local tween1 = TS:Create(intro1, ti, {Transparency = 1 })
local tween2 = TS:Create(intro1img, ti, {ImageTransparency = 1 })
tween1:Play()
tween2:Play()
wait(3)
text.Text = "Starting..."
wait(.6)
text.Text = "Initiating panel...Please wait."
wait(1)
text.Text = ""
do
-- Main Configs
local ti2 = TweenInfo.new(
.5,
Enum.EasingStyle.Exponential,
Enum.EasingDirection.Out,
0,
false,
.5)
local tween = TS:Create(bg, ti2, { Position = target })
tween:Play()
-- Intro Configs
local ti = TweenInfo.new(
.6,
Enum.EasingStyle.Cubic,
Enum.EasingDirection.In,
0,
false,
.5)
local twee = TS:Create(intro, ti, {Transparency = 1})
local twee1 = TS:Create(text, ti, {TextTransparency = 1})
local twee2 = TS:Create(regiment, ti, {ImageTransparency = 1})
local twee3 = TS:Create(introtext, ti, {TextTransparency = 1})
local twee4 = TS:Create(picture, ti, {ImageTransparency = 1})
local twee5 = TS:Create(pictureborder, ti, {Transparency = 1})
twee:Play()
twee1:Play()
twee2:Play()
twee3:Play()
twee4:Play()
twee5:Play()
end
announce.Interactable = true
revokeBan.Interactable = true
plrinf.Interactable = true
moderate.Interactable = true
print("Category buttons have been activated.")
end
end)