I’m new to scripting so I apologize in advance for any confusion or mistakes I make. So recently I scripted a code that is inside of a button, that upon clicked will start a countdown and after the countdown ends, a timer will start and after touching a part the timer will stop. I got that part working but the problem is that its all inside of one local script under the start button. I want to convert the data of the final time to the starting place of the game.
local finalTime = tonumber(startTimerLabel.Text)
above is the variable where I store my final time.
startTimerLabel is the textLabel where the timer is being updated and I have a code that freezes the timer when it touches a part.
I just want some general tips and pointers to avoid getting myself in a rabbit searching for a solution for hours
sorry for the late reply but after some digging I think I would want a remote functions for two way communication between the server and client (client initiates the remote, server script does the countdown and timer logistics and sends back the data to the client) but i just read about Remote Events and Callbacks Documentation so sorry if this sounds stupid
I wanted to have a 2 way connection because i watched a video about how cheaters can easily access the local side scripts, or something along the lines of that so im hesitant in programming the timer logistics in a local script. But again Im not 100% sure.
Cheaters could also send false data (using RemoteEvents and RemoteFunctions) to the server so I recommend having checks on the server if the data exists and is valid. Never trust the client with anything. Only trust the server.
you can use remote event while using the server to check if it the data exists like @lilmazen1234 said,
a remote can still be useful, but you always must have checks in the server script for security reasons