Okay, so I am creating a counter for the amount of days until Christmas, and this is the code I managed to get:
date = os.time{day=25,year=2018,month=12}
today = os.difftime(os.time() - 18000, date)/(24*60*60)
wholedays = math.floor(today) * -1
When I print the variable “wholedays” it does print 30 as expected, since at the time of writing this it is 30 days until the 25th of December.
However, when I try to use it in my event:
game:GetService("ReplicatedStorage").days:FireClient(wholedays)
(the code for the event is
game:GetService("ReplicatedStorage").days.OnClientEvent:Connect(function(daystill)
script.Parent.Text = daystill
end)
)
I get this error:
Unable to cast value to Object
17:03:33.179 - Stack Begin
17:03:33.179 - Script ‘ServerScriptService.countdownHandler’, Line 6
17:03:33.180 - Stack End
I might just be really dumb, but I can not see why I keep getting this error.
UPDATE
I just realized, I was called :FireClient instead of :FireAllClients, it works now.