Basically, I want the GUI to open when the player gains EXP. So far it opens fine but wont close. I have a time set which it is open for before closing. The time seems to go down by 5 instead of going to 5 and taking away 1 each second.
local Player = game.Players.LocalPlayer
local Data = Player:WaitForChild("Data")
local Time = script.Parent:WaitForChild("Time")
local Frame = script.Parent
Data.Exp.Changed:connect(function(property)
Time.Value = 5
Frame:TweenPosition(UDim2.new(0.3, 0,0, 60), "Out", "Quad", 0.5, true)
end)
Time.Changed:connect(function(property)
if Time.Value > 0 then
repeat
Time.Value = Time.Value -1
wait(1)
until Time == 0
elseif Time.Value == 0 then
Frame:TweenPosition(UDim2.new(0.3, 0,0, -100), "Out", "Quad", 0.5, true)
wait(1)
end
end)
