ERROR : Unable to cast token
WHAT DOES THAT ERROR MEAN?!?!!?!?!
Instance_CMD('Countdown',1,function(Plr,Msg) coroutine.wrap(function() for _,v in pairs(game.Players:GetPlayers()) do local Gui=Instance.new('ScreenGui',v) local Fm=Instance.new('Frame',v) Fm.Size=UDim2.new(1,0,0.1,0) Fm.Position=UDim2.new(0,0,-0.1,0) Fm.Style='DropShadow' Fm:TweenPosition(UDim2.new(0,0,0,0),3,4,7) local Tx=Instance.new('TextLabel',Fm) Tx.BackgroundTransparency=1 Tx.Size=UDim2.new(1,0,1,0) Tx.Font='ArialBold' Tx.FontSize='Size24' Tx.TextColor3=Color3.new(85/255/0) Tx.TextStokeTransparency=0 for i = tonumber(Msg),0,1 do -- I believe this is the error line... wait(1) Tx.Text='Countdown [ '..i..' ]' if i==0 then Gui:remove() break end end end end)() end)
I suggest, like Redbullusa said, to make the third argument in the for loop on line 17 a negative integer. Because you're counting down then you're going to need to go in increments of a negative value.
As a second suggestion, just to make sure we're only getting numbers for arguments in the for loop, use string.match() with %d+, the operater for numbers, as the matching argument.
Example;
for i = tonumber(Msg:match("%d+")),0,-1 do --code end
And I have no idea what that error means, so I can't help you there..