Tycoon Button not Buying Object?
HEY, there, I am having a issue with my tycoon. There is Not any errors.
Tycoon Main Script (game.Workspace.Tycoons.Red Team.Main) :
01 | local TycoonInfo = script.Parent.TycoonInfo |
02 | local OwnerValue = TycoonInfo.Owner |
03 | local CashToColectValue = TycoonInfo.CashToCollect |
04 | local Buttons = script.Parent.Buttons |
05 | local Purchases = script.Parent.Purchases |
06 | local Purchased = script.Parent.Purchased |
12 | function DoDevProductPurchase() |
16 | function ValidDateHitbyowner(Hit) |
17 | if Hit and Hit.Parent and Hit.Parent:FindFirstChild( "Humanoid" ) then |
18 | local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) |
19 | if Player and Player = = OwnerValue.Value then |
27 | for i, v in pairs (Buttons:GetChildren()) do |
28 | local Object = Purchases:FindFirstChild(v.Object.Value) |
30 | Objects [ Object.Name ] = Object:Clone() |
32 | if v:FindFirstChild( "Dependency" ) then |
33 | coroutine.resume(coroutine.create( function () |
34 | v.Button.Transparency = 1 |
35 | v.Button.CanCollide = false |
36 | if Purchased:WaitForChild(v.Dependency.Value, 90000 ) then |
37 | v.Button.Transparency = 0 |
38 | v.Button.CanCollide = false |
43 | v.Button.Touched:Connect( function (Hit) |
46 | if v.Button.Transparency = = 0 then |
47 | if ValidDateHitbyowner(Hit) then |
48 | local MoneyValue = game.ServerStorage.PlayerMoney:FindFirstChild(OwnerValue.Value.Name) |
50 | if MoneyValue.Value > = v.Price.Value then |
51 | MoneyValue.Value = MoneyValue.Value - v.Price.Value |
52 | Objects [ v.Object.Value ] .Parent = Purchased |