So I have this local timer script which functions when server fires the client. The issue is that studio thinks that the 'for' in the script must be some number.
function getdata(Plr,Secs) for s = Secs,0,-1 do wait(1) script.Parent.Secs.Text = s end end game.ReplicatedStorage.Special.GiveTimer.OnClientEvent:Connect(getdata)
Yes it needs to be a number, you're using Secs
a variable (that isn't a number). You need to set it to a starting value (number). You can use a variable but it needs to be a number as the error stated.
Update: I just noticed you have 2 arguments to the function, but OnClientEvent
doesn't provide the player argument since it's the server firing and the clients player is localplayer. Just remove the Plr
from function getdata(Plr,Secs)
and it will probably work. If you're firing the event with a number that number will be in Plr
and Secs
will be nil.