Hi, I’m trying to make a script though on line 40 it says it attempted to call a table value.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local DoorMessage = ReplicatedStorage.Events:WaitForChild("DoorMessage")
local TimerSpeed = ReplicatedStorage.Values:WaitForChild("TimerSpeed")
local MultiplierVisible = ReplicatedStorage.Values:WaitForChild("MultiplierVisible")
local Multiplies = ReplicatedStorage.Values:WaitForChild("Multiplies")
local Minutes = ReplicatedStorage.Values:WaitForChild("Minutes")
local Seconds = ReplicatedStorage.Values:WaitForChild("Seconds")
local Winners = {}
script.Parent.Touched:Connect(function(Hit)
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if not Hit.Parent:FindFirstChild("Humanoid") then return end
if table.find(Winners, Player.UserId) then return end
table.insert(Winners, Player.UserId)
TimerSpeed.Value = TimerSpeed.Value / 2
DoorMessage:FireAllClients(Player)
MultiplierVisible.Value = true
Multiplies.Value = Multiplies.Value * 2
local PlayerCandy = Player.leaderstats:WaitForChild("🍬 Candy")
local CandyValue = Player.DoubleCandy.Value and 160 or 80
if not PlayerCandy then return end
PlayerCandy.Value += CandyValue
end)
Minutes.Changed:Connect(function()
if Minutes.Value == 3 and Seconds.Value == 0 then
Winners{}
end
end)
Error:
Any help is appreciated!