Follow up to " **Cheat-proof Speedrun and timer** "

This is a follow-up post to Cheat-proof Speedrun and timer where I was trying to find out a way to make a timer server-side to avoid local script cheating for speedruns.

In this post, the main response was to use Remote Events to send the server-side timer to a local player’s GUI - to avoid cheating

I created a new system to do just that

Local Script

Local Script:

--[ Timer Start ]--

local start = workspace.Start
local event = game:GetService("ReplicatedStorage").RemoteEvent

deb = false
start.Touched:Connect(function()
	if deb == false then deb = true 
	event:FireServer()
	end
	repeat wait() until -- "finished"
	deb = false
end)

-----------------------------------------------------------

--[ Update GUI ]--

local text = script.Parent.TextLabel
local value = script.Parent.Value

local function timer(min, sec, milli)	
	
	value.Value = min + sec + milli
	text.Text = tostring(value.Value)
	
end

game.ReplicatedStorage.timer.OnClientEvent:Connect(function(min, sec, milli)
	-- text.Text = min .. " : " .. sec .. " : " .. milli
end)

*note that I replaced some script with comments to make it faster to read

Local script Simplified:

  1. Touch Start Part > Fire Server Event
  2. On Client Event > Update GUI with values
Server Script

Server Script:

local finish = workspace.Finish
local event = game:GetService("ReplicatedStorage").RemoteEvent
	
event.OnServerEvent:Connect(function(player)
	
local milli = 0
local sec = 0
local min = 0
	
	print(player.Name .. " has started!")
	
	while true do
		
		wait(.1)
		
		milli = milli + 1
		if milli > 9 then
			milli = 0
			sec = sec + 10
		end
		
		if sec > 590 then
			sec = 0
			min = min + 1000
		end
		
		game.ReplicatedStorage.timer:FireClient(player, min, sec, milli) -- Send info to client
		
		deb = false
		finish.Touched:Connect(function()
			-- Stop timer
			-- Send info to leaderboard
			end
		end)
		
		if workspace.Finish.Transparency > 0 then break end
		
	end
	
end)

*note that I replaced some script with comments to make it faster to read

Server script Simplified:

  1. On Server Event > Start Timer > Fire Client with Timer information
  2. Touch Finish Part > Stop Timer

Problem:
The remote event that triggers the ‘player’ is triggering everyone’s GUI - just like FireAllClients()

Video: https://youtu.be/d4kxrGi1Cgk

I thought passing the ‘player’ argument through the FireClient() would only update that particular player’s GUI on - Server script, Line 26

game.ReplicatedStorage.timer:FireClient(player, min, sec, milli)

For me to fully understand what is going on my questions are:

  1. What am I doing wrong?
  2. How can I fix it?

In conclusion, I want to thank everyone that took their time to read this and a special thanks for any replies.

I also want to thank @CasuallyCritical, @rogchamp and @flamenco_687 for replying on my last post

2 Likes

image


2 Likes

My bad, I just fixed it
30 charssssssssss

1 Like

you ever fix the problem and how?

Option 1
You can record a default time.
If they finish before the default time, then there’s something wrong (however this should be taken into consideration as people can get really good at these type of games).

Option 2
A: localscript detecting if their walkspeed property is changed.
B: Record their speed on the server every X seconds.

After all, you could have all these checks take place.