Hey guys, I am trying to make a playtime gift rewards system that:
#1 Is not cheatable, so no countdowns on the client
#2 Updates on the client without having to send an event every second from a server loop
I am assuming I have to keep countdowns / timer information in the server and then a secondary one in the client for the GUI and then check on the server if both timers are the same once the player claims the reward to make sure it was not exploited?
I am just not sure how to make the timers on the server
I got this so far:
--Client
local function SetupRewards(times)
-- Loop through the rewards GUI and set the countdown text
for i, v in pairs(oContainer:GetChildren()) do
if v:IsA("Frame") then
local countdownText = v.Countdown
-- set the text based on our server table for each reward and format
countdownText.Text = convertToHMS(times[v.LayoutOrder]*60)
end
end
end
--Server
local rewardTimes ={
1, 5, 10, ...
}
-- Im assuming I keep track of all player time here?
local playerRewardsCountdowns = {}
game.Players.PlayerAdded:Connect(function(plr)
--Start a timer for each here?
table.insert(playerRewardsCountdowns, plr)
reSetUpPlaytimeRewards:FireClient(plr, rewardTimes)
end)
Any help is super mega appreciated, thanks in advance!