Hello everyone. I can't understand what's going on. The script works, but it constantly gives an error. Here are the parts of the code:
local durationTime = 10
local startTime = {}
local correntTime = {}
function handleOverlap(trigger, player)
if player ~= nil and player:IsA("Player") then
startTime[player] = time()
player:SetResource("StimulantBigHP", 1)
.......
end
end
function bigHPEnd (player)
if player:GetResource("StimulantBigHP") == 1 then
correntTime[player] = time()
if correntTime[player] < startTime[player] + durationTime then
.......
end
end
end
function Tick()
for _, player in pairs(Game.GetPlayers()) do
bigHPEnd(player)
end
end
An error pops up all the time in this line (attempt to perform arithmetic on a nil value (field '?')):
if correntTime[player] < startTime[player] + durationBigHPTime then
But at the same time, the code works. Can anyone tell me what's wrong?