local replicatedStorage= game:GetService("ReplicatedStorage")
local ServerStorage= game:GetService("ServerStorage")
local tools = ServerStorage:FindFirstChild("Tools")
local scripts = ServerStorage:FindFirstChild("Script")
local toolConfig = require(game.ServerStorage:WaitForChild("MontalayaciAhmetUSta"):WaitForChild("ToolConfig"))
local remotes = replicatedStorage:FindFirstChild("Remotes")
remotes.ToolActivatedRemote.OnServerEvent:Connect(function(player)
warn("Client", player, "activated a tool")
print("Find tool's stats in SV module of:", toolConfig[player.Inventory.EquippedTool.Value]["Stat"]) --Error is here
if toolConfig[player.Inventory.EquippedTool.Value] then -- if toolConfig["Red"] Blue, etc is found in SV module
player.leaderstats.Strength.Value += toolConfig[player.Inventory.EquippedTool.Value]["Stat"]
remotes.TextChange:FireClient(player, toolConfig[player.Inventory.EquippedTool.Value["Stat"]) -- Sending updated data back to client
print("MENONLOKOMATÄ°F")
end
end)
but it doesnât print âMenonlokomatifâ and I get this error: attempt to index nil with âStatâ
screenShoot of ToolConfig
how Can I fix it without changing ToolConfig?
and if I delete the [Stat] at error line It prints " Find toolâs stats in SV module of: nil"