I’ve tried IntValue and NumberValue but the stopwatch system has unsupported characters that prevent it.
This is the part of the script that i’ve been looking at. (I remember following a tutorial for this because i was struggling)
if hit.Parent.Name == game.Players.LocalPlayer.Name then
Running = false
Run = false
if (Minutes*59.999 + Time) < BestTime and (Minutes*59.999 + Time) > 0.001 then
BestTime = Minutes*59.999 + Time
BestTimeText.Text = "Best Time: "..ActualTimeText.Text
BestTimeEvent:FireServer(ActualTimeText.Text, game.Players.LocalPlayer)
print(ActualTimeText.Text)
script.Parent.Time.Value = ActualTimeText.Text
end
wait(3)
Stopwatch.Enabled = false
Time = 0
Minutes = 0
end
end)
Have you tried tostring()? It converts everything the brackets to a string (if it supported character like A number) I don’t see it at all in the script.
Tostring() is a roblox built-in function that inside the brackets will convert to a string pretty simple so in your script it would look like
if hit.Parent.Name == game.Players.LocalPlayer.Name then
Running = false
Run = false
if (Minutes*59.999 + Time) < BestTime and (Minutes*59.999 + Time) > 0.001 then
BestTime = tostring((Minutes*59.999 + Time))
BestTimeText.Text = "Best Time: "..ActualTimeText.Text
BestTimeEvent:FireServer(ActualTimeText.Text, game.Players.LocalPlayer)
print(ActualTimeText.Text)
script.Parent.Time.Value = ActualTimeText.Text
end
wait(3)
Stopwatch.Enabled = false
Time = 0
Minutes = 0
end
end)
That should be it if theres any spelling mistakes that on me bc im typing on mobile.
Also another thing when firing a remoteevent to the sever the first argument is the player who sent it (in the sever script). So there is no need on line 7 to be sending the local player over. Thats just wasting resources. Thank you for reading.
Im confused, if your trying to turn the text into a string it should already be a string. Are you trying to set the stringvalue on the client on while checking on the sever? Because when you set something in a local script THE ONLY person who can see it is your character/player so set the varible on the server if your trying to access it on the sever
This already looks convoluted. It’s possible to record time in milliseconds and simply use math or DateTime to format the milliseconds to hours, minutes, seconds, and such. This is generally what professional projects do
Pretty sure most of it is done on the client.
I have an endpoint and when touched it stops the timer and shows a level completed GUI.
The level completed GUI has text that shows the time taken but the script that edits the text for the gui is in a different script to the stopwatch GUI
If time is not actively shown, then there is no need to record anything but a beginning timestamp. Once again, math can be used to determine the elapsed milliseconds