How would I go about creating a VAR System for ROBLOX TPS?

I want to create a football league, but I am troubled by how to create a VAR System. Alex's MPS Uncopylocked Pitch - Roblox
has a VAR system, but barely works.

My question is mainly focused on how would I have a camera that replays the goal, and lets the officials vote.

The camera replay system is actually pretty simple, Ive done quite alot of work on replay systems, even saving recordings to a datastore and replaying them after.

You can find a bunch of resources about making replay systems, but how they essentially work is that they record CFrames of the objects you want, while tied to some sort of runservice event like .heartbeat or .stepped, to be played after in a viewportgui

Since you don’t want to make a recording of an entire match just for one var replay, (since that would take a massive amount of memory) you could delete recorded cframes that are older than 30 seconds.

Although most resources that teach replays do it from a localscript, (since its easy to just transfer the recorded data to the viewport from there) you can do it from a server script, and its more reliable as client lag wont be a factor for affecting the quality of the recording.

This is one of the easiest replay resources that I’d recommend learning and understanding for your purposes, as it may help you create what you want. Good luck!

local replay = require(script.Parent:WaitForChild("Replay"))

local recordingSettings = {
	LiveReplay = true, -- Should a preview be shown in the replay window?
	Frame = script.Parent:WaitForChild("ReplayFrame") -- What frame to render the replay to
}
local length = 60 -- Length to capture
local speed = 0.5 -- Speed of replay (0.5 is half speed)
print("Starting "..length.."s recording!")

local recording = replay:BeginRecording(recordingSettings) -- Start capturing a recording

wait(length) -- Wait a bit until we want to finish capturing the replay
recording:Stop() -- Stop recording the replay

script.Parent.Frame.offside.MouseButton1Click:Connect(function()
	local t = tick()
	recording:Replay()
	script.Parent.ReplayFrame.Visible = true
	wait(length * 2)
	recording:Destroy()
	script.Parent.ReplayFrame.Visible = false
end)



That’s my current code, and I don’t know how I can make it so when a player clicks the CALL OFFSIDE button, it replays immediately.

Same for goal if its a suspected goal line clearence.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.