Hello my Friends,
I actually use a script to count the “Clicks” i make when i click on the Screen and the Counted Number is showed on the Screen for a Second. Now i have the Problem that when you higher your Clicks per second to like 10CPS but then lower it to like 5CPS the Number is not longer showed on the Screen and this pops up on the console:
Players.MeloneHD98.PlayerGui.ClicksPop:11: attempt to compare nil < number
Here is the Script i use, can somebody help me?
wait();
local u1 = { "", "K", "M", "B", "T", "Qd", "Qn", "sx", "Sp", "O", "N", "D", "Ud", "DD", "tdD", "qdD", "QnD", "sxD", "SpD", "OcD", "NvD", "Vgn", "UVg", "DVg", "TVg", "qtV", "QnV", "SeV", "SPG", "OVG", "NVG", "TGN", "UTG", "DTG", "tsTG", "qtTG", "QnTG", "ssTG", "SpTG", "OcTG", "NoAG", "UnAG", "DuAG", "TeAG", "QdAG", "QnAG", "SxAG", "SpAG", "OcAG", "NvAG", "CT" };
local function v1(p1)
for v2 = 1, #u1 do
if tonumber(p1) < 10 ^ (v2 * 3) then
return math.floor(p1 / (10 ^ ((v2 - 1) * 3) / 100)) / 100 .. u1[v2];
end;
end;
end;
local plr = game.Players.LocalPlayer
local ms = plr:GetMouse()
local stat = plr:WaitForChild("leaderstats")["Clicks"]
local val = plr:WaitForChild("leaderstats")["Clicks"].Value
stat.Changed:Connect(function()
wait(0.1)
local text = script.Parent.SoulsScreen.TextLabel:Clone()
text.Parent = script.Parent.SoulsScreen
text.Name = "+".. tostring(stat.Value-val)
text.Text = v1("+".. tostring(stat.Value-val))
text.Rotation = math.random(-20, 20)
text.Visible = true
local pos = UDim2.new(math.random(0,1000)/1000, 0,0.924, 0)
text.Position = pos
text:TweenPosition(pos-UDim2.new(0,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,1)
wait(1)
val = stat.Value
text:Destroy()
end)