TheErrorMessage: Workspace.TronixsTycoonKit.TycoonHandle:47: attempt to index nil with 'Value'
local Settings = require(workspace.TronixsTycoonKit.Settings)
local TeamService = game:GetService("Teams")
local Tycoon
local Player
local Character
local Owner
local Gate
local Bool = true
local leaderstats = workspace.TronixsTycoonKit.Leaderstats.Value
workspace.Sounds.Sound1.SoundId = Settings.Sounds.CollectMoney
workspace.Sounds.Sound2.SoundId = Settings.Sounds.ErrorBuy
workspace.Sounds.Sound3.SoundId = Settings.Sounds.SuccesBuy
for i,v in pairs(script.Parent.Tycoons:GetChildren()) do
Tycoon = v
local Index = i
Owner = v.Owner.Value
Gate = v.Entrance.Gate.TouchPart
Gate.Touched:Connect(function(Char)
if Char.Parent:FindFirstChildWhichIsA("Humanoid") then
Character = Char.Parent
Gate.Transparency = 0.4
Owner = Character.Name
Gate.BillboardGui.TextLabel.Text = Owner.."'s Tycoon"
Player = game.Players:GetPlayerFromCharacter(Character)
--[[ Player.Team = PlayersTeam
print(Player.Team) --]]
end
end)
end
for i,v in pairs(Tycoon.Buttons:GetChildren()) do
if v:FindFirstChild("Dependency") then
print(v.Name.." Is Have Dependency")
else
local Model = v.Object.Value
for I,V in pairs(Model:GetDescendants()) do
if V:IsA("Part") then
V.Transparency = 1
end
v.Button.Touched:Connect(function(Char)
if Bool == true then
Bool = false
if Char.Parent:FindFirstChildWhichIsA("Humanoid") then
if Char.Parent == Character then
if Character.Name == Owner then
if leaderstats.Value >= v.Cost then
workspace.Sounds.Sound3:Play()
if V:IsA("Part") then
v:Destroy()
wait(0.2)
V.Transparency = 0.9
wait(0.2)
V.Transparency = 0.8
wait(0.2)
V.Transparency = 0.7
wait(0.2)
V.Transparency = 0.6
wait(0.2)
V.Transparency = 0.5
wait(0.2)
V.Transparency = 0.4
wait(0.2)
V.Transparency = 0.3
wait(0.2)
V.Transparency = 0.2
wait(0.2)
V.Transparency = 0.1
wait(0.2)
V.Transparency = 0
elseif V:IsA("Script") then
V.Disabled = false
end
else
workspace.Sounds.Sound2:Play()
end
end
end
end
wait(1)
Bool = true
end
end)
end
end
end~~~~~~~~~~~~~~~~~

2 comments
The main error is on line 51
no, 50