Im having this issue: My notify script where its meant to pop up with this specific level up message which it does but once it does it just loops and loops . Its meant to fire each time a new level. help!
LevelNotify Script:
GUI:WaitForChild("LevelUp").Event:connect(function(lvl)
if allow and Enabled.Value then
allow = false
Frame.Visible = false
Label.Text = "LEVEL UP!"
Level.Text = "NEW LEVEL!"
local LVL_HUE = math.clamp(tonumber(lvl) or math.random(1, 10) * 100, 1, 1000) / 1000 * 0.8333333333333334
local color = Color3.fromHSV(LVL_HUE, 1, 1)
for i, v in ipairs(Lines) do
v.BackgroundColor3 = color
v.BackgroundTransparency = 1
end
for i, v in ipairs(Lines_LVL) do
v.BackgroundColor3 = color
v.BackgroundTransparency = 1
end
Frame.Position = UDim2.new(0.5, 0, 0.45, 0)
Label.TextTransparency, Level.TextTransparency = 1, 1
Label.TextColor3, Level.TextColor3 = color, color
animateGUI()
allow = true
end
end)
THE script where i fire the xp notification:
function LevelNotify(lvl)
Player.PlayerGui.LevelNotify.LevelUp:Fire(lvl)
end
function onLevelUp(lvl)
Info.XP.Bar.Level.Text = "LEVEL "..lvl
setLevel(lvl)
end
Database.Notify.OnClientEvent:connect(function(action,...)
local vars = {...}
if action == "new tp" then
sfx("tick")
onPointsAdded(vars[1])
elseif action == "new level" then
sfx("tick")
onLevelUp(vars[1])
LevelNotify(vars[1])
elseif action == "new xp" then
sfx("tick")
onXPChange(vars[1])
end
end)
onLevelUp(sendControl("get level"))
onPointsAdded(sendControl("get tp"))
onXPChange(sendControl("get xp"))
All i need is for it to stop looping and only fire when u hit "new level".

2 comments
Set a variable or something that is set false, then set it true whenever it fires the remote. make it so if its true it cant call again
Exactly, My mistake. Thanks for correcting me