Well I've made a script, where the Server sends the time of lighting to Client. The Clientside script seems to work fine, but a error in the Output pops up the whole time.
22:06:24.160 - Players.bbudder.PlayerGui.CS.Main.TimeModule [FE]:6: attempt to concatenate local 'STime' (a nil value)
22:06:24.162 - Stack Begin
22:06:24.163 - Script 'Players.bbudder.PlayerGui.CS.Main.TimeModule [FE]', Line 6
22:06:24.164 - Stack End
Clientside:
local CoreGui = game.Players.LocalPlayer.PlayerGui local Time = CoreGui.CS.Main.TimeDisplay local Event = game.ReplicatedStorage.ServerTime Event.OnClientEvent:Connect(function(STime) Time.Text = ""..STime end)
Serverside:
local Event = game.ReplicatedStorage.ServerTime while true do wait(1) local STime = game.Lighting.TimeOfDay Event:FireAllClients(STime) end
Any answers would be appreciated. How can I avoid this?
++EDIT Even if I replace / Time.Text = ""..STime / with /Time.Text = STime / then this message pops up:
22:23:16.810 - Players.bbudder.PlayerGui.CS.Main.TimeModule [FE]:6: bad argument #3 to > 'Text' (string expected, got nil)
You can use tostring
The wiki page say that it's value type is a string.
So THEY did fixed my problem about the Error using tostring. But the problem is that the CLIENT SIDE script is firing, EVEN if the SERVER is not firing.
So yes, using tostring fixed the error stuff.