--- Variables --- local TycoonModel = script.Parent.Parent local Items = {} local en = require(game.ReplicatedStorage.EternityNum.EternityNum) --- Folders --- local BoughtItems = TycoonModel:FindFirstChild("BoughtItems") local MainItems = TycoonModel:FindFirstChild("MainItems") local Scriptsprobablynotneeded = TycoonModel:FindFirstChild("Scripts") local Buttons = TycoonModel:FindFirstChild("Buttons") local Values = TycoonModel:FindFirstChild("Values") local DropperParts = TycoonModel:FindFirstChild("DropperParts") --- Scripts --- local tycoonClone = TycoonModel:Clone() tycoonClone.Parent = game.ReplicatedStorage MainItems.OwnerDoor.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and Values.OwnerValue.Value == nil then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr:FindFirstChild("OwnsTycoon").Value == false then local function money() while wait() do plr.MoneyinBank.Value = Values.CashValue.Value end end Values.OwnerValue.Value = plr MainItems.OwnerDoor.CanCollide = false MainItems.OwnerDoor.SurfaceGui.TextLabel.Text = tostring(Values.OwnerValue.Value).."'s Tycoon" plr.OwnsTycoon.Value = true spawn(money) end end end) --- Buying Scripts for i,v in pairs(Buttons:GetChildren()) do v.ButtonPart.BillboardGui:WaitForChild("TextLabel").Text = v.Item.Value.." - $"..en.short(v.Price.Value) local newItem = BoughtItems:FindFirstChild(v.Item.Value) if newItem ~= nil then Items[newItem.Name ] = newItem:Clone() newItem:Destroy() else v.ButtonPart.Transparency = 1 v.ButtonPart.CanCollide = false v.ButtonPart.BillboardGui.TextLabel.Visible = false end if v:FindFirstChild("Dependency") then coroutine.resume(coroutine.create(function() v.ButtonPart.Transparency = 1 v.ButtonPart.CanCollide = false v.ButtonPart.BillboardGui.TextLabel.Visible = false if BoughtItems:WaitForChild(v.Dependency.Value, 123122039) then v.ButtonPart.Transparency = 0 v.ButtonPart.CanCollide = true v.ButtonPart.BillboardGui.TextLabel.Visible = true end end)) end v.ButtonPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if Values.OwnerValue.Value == plr then if v.ButtonPart.CanCollide == true and v.ButtonPart.Transparency == 0 then if en.meeq(plr:WaitForChild("Stats").Money.Value,v.Price.Value) then local vv = en.sub(en.convert(plr.Stats.Money.Value),en.convert(v.Price.Value)) plr.Stats.Money.Value = en.bnumtostr(vv) Items[v.Item.Value].Parent = BoughtItems v:Destroy() end end end end end) end --- Cash Scripts --- local Debouce = false MainItems.CashButton.ButtonPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if Values.OwnerValue.Value == plr then print("lol") if Debouce == false then Debouce = true local Cash = en.convert(plr:FindFirstChild("Stats").Money.Value) local va = en.add(Cash,en.convert(Values.CashValue.Value)) plr:FindFirstChild("Stats").Money.Value = en.bnumtostr(va) plr.MoneyinBank.Value = en.bnumtostr(va) wait() Values.CashValue.Value = "0" plr.MoneyinBank.Value = "0" wait(1) Debouce = false end end end end) while wait() do MainItems.CashButton.Screen.SurfaceGui.TextLabel.Text = "Cash: $"..en.short(Values.CashValue.Value) end