Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plot = {}
- local Zone = require(script.Parent.Zone)
- local Data = require(script.Parent.DataManger)
- local process = require(script.Parent.Process)
- local NumberAnimation = require(script.Parent.NumberAnimation)
- plot.__index = plot
- plot.GoatInfo = {["Normal Goat"] = {["Give"] = 1, ["Color"] = Color3.fromRGB(250, 250, 250)},
- ["Chocolate Goat"] = {["Need"] = {["Normal Goat"] = 6} ,["Give"] = 10, ["Color"] = Color3.fromRGB(99, 95, 98)},
- ["Strawberry Goat"] = {["Need"] = {["Chocolate Goat"] = 5} ,["Give"] = 50, ["Color"] = Color3.fromRGB(106, 57, 9)},
- ["Mango Goat"] = {["Need"] = {["Strawberry Goat"] = 4},["Give"] = 200, ["Color"] = Color3.fromRGB(245, 205, 48)},
- ["Lemon Goat"] = {["Need"] = {["Mango Goat"] = 3} ,["Give"] = 650, ["Color"] = Color3.fromRGB(52, 142, 64)},
- ["Kiwi Goat"] = {["Need"] = {["Lemon Goat"] = 3} ,["Give"] = 2000, ["Color"] = Color3.fromRGB(77, 107, 141)},
- ["Silver Goat"] = {["Need"] = {["Kiwi Goat"] = 3} ,["Give"] = 6500, ["Color"] = Color3.fromRGB(171, 60, 60)},
- ["Gold Goat"] = {["Need"] = {["Silver Goat"] = 3} ,["Give"] = 25000},
- ["Diamond Goat"] = {["Need"] = {["Gold Goat"] = 2} ,["Give"] = 45000},
- ["Amethyst Goat"] = {["Need"] = {["Diamond Goat"] = 2} ,["Give"] = 100000},
- ["Rainbow Goat"] = {["Need"] = {["Amethyst Goat"] = 2} ,["Give"] = 250000}
- }
- plot.strongestGoat = {["Rainbow"] = 11 ,["Amethyst"] = 10,["Diamond"] = 9 ,["Gold"] = 8,["Silver"] = 7 ,["Kiwi"] = 6 ,["Lemon"] =5, ["Mango"] =4,["Strawberry"] = 3,["Chocolate"] = 2 ,["Normal"] = 1}
- local tween = game:GetService("TweenService")
- function plot.New(plr)
- local self = {}
- self.plr = plr
- return setmetatable(self,plot)
- end
- function plot.EnterZone(plr,deb,plot1,obj:Instance)
- local tweeninfo = TweenInfo.new(0.2,Enum.EasingStyle.Quint,Enum.EasingDirection.In,0)
- local endpos = tween:Create(obj.Button,tweeninfo,{CFrame =obj.Endposition.CFrame })
- local oldCFrame = obj.Button.CFrame
- deb[obj.Name] = true
- endpos:Play()
- endpos.Completed:Connect(function()
- game.ReplicatedStorage.events.Sound:FireClient(plr,"Button")
- local start = tween:Create(obj.Button,tweeninfo,{CFrame =oldCFrame })
- start:Play()
- start.Completed:Wait()
- end)
- end
- function plot:ChoosePlotrandomly(chr)--======>Choosing random plot
- local tab = {}
- for i,v in pairs(workspace.Plots:GetChildren())do
- if v:IsA("Model") then
- if v:GetAttribute("Owner") == "" then
- table.insert(tab,v)
- end
- end
- end
- local random = math.random(1,#tab)
- tab[random]:SetAttribute("Owner",self.plr.Name)
- return tab[random]
- end
- function plot:SetNameOnSign(plot,Text)--======>Set Name Of Player on tycoon sign
- plot.Decor.Entry.Part1.SurfaceGui.TextLabel.Text = Text
- end
- function plot.LoadingInfoGoatType(plot)--======>Put Info Merge goat at board
- for i,v in pairs(plot.Decor.Board.GUI.SurfaceGui:GetChildren())do
- if v:IsA("TextLabel") then
- v.Visible = not v.Visible
- end
- end
- end
- function plot.PutGoatinBern(plot1,typee,Data1,Status)--======>Put Goats In Bern
- local tab = {}
- for i,v in pairs(plot1.Bern.Places:GetChildren())do
- if v:IsA("Model") then
- if not v:GetAttribute("IsFull") then
- for l,m in pairs(v.Places:GetChildren())do
- if m:IsA("Part") then
- if not m:GetAttribute("IsFull") then
- table.insert(tab,m)
- end
- end
- end
- end
- end
- end
- if #tab ~= 0 then
- tab[1]:SetAttribute("IsFull",true)
- if typee == "Rainbow" then
- local clone:Model = game.ServerStorage.Storage.Goats[typee.." Goat"]:Clone()
- clone.Parent= tab[1].Parent.Parent.Parent.Parent.Goats
- clone:PivotTo(tab[1].CFrame *CFrame.Angles(0,math.rad(-90),0)* CFrame.new(0,0.5,0))
- clone.Name = "Goat"..#tab[1].Parent.Parent.Parent.Parent.Goats:GetChildren()
- if Status ~= "Load" then
- table.insert(Data1.GoatsInBern,typee)
- end
- clone:SetAttribute("Type",typee)
- if clone:FindFirstChild("Yes") then
- local cor = coroutine.create(function()
- while task.wait() do
- if clone:FindFirstChild("Yes") then
- local t = 10;
- local hue = tick() % t / t
- local colorrr = Color3.fromHSV(hue, 1, 1)
- clone.Yes.Color = colorrr
- end
- end
- end)
- coroutine.resume(cor)
- end
- else
- local clone:Model = game.ServerStorage.Storage.Goats[typee.." Goat"]:Clone()
- clone.Parent= tab[1].Parent.Parent.Parent.Parent.Goats
- clone:PivotTo(tab[1].CFrame *CFrame.Angles(0,math.rad(-90),0)* CFrame.new(0,0.5,0))
- clone.Name = "Goat"..#tab[1].Parent.Parent.Parent.Parent.Goats:GetChildren()
- if Status ~= "Load" then
- table.insert(Data1.GoatsInBern,typee)
- end
- clone:SetAttribute("Type",typee)
- end
- else
- local clonebern = game.ServerStorage.Storage.Temp1:Clone()
- clonebern:SetPrimaryPartCFrame(plot1.Bern.Places["Temp"..#plot1.Bern.Places:GetChildren()]:GetPrimaryPartCFrame()* CFrame.new(0,9,0))
- plot1.Bern.Places["Temp"..#plot1.Bern.Places:GetChildren()]:SetAttribute("IsFull", true)
- clonebern.Parent = plot1.Bern.Places
- clonebern.Name = "Temp"..#plot1.Bern.Places:GetChildren()
- plot1.Bern.Roof:SetPrimaryPartCFrame(plot1.Bern.Places["Temp"..#plot1.Bern.Places:GetChildren()]:GetPrimaryPartCFrame()* CFrame.new(0,7,0))
- for i,v in pairs(plot1.Bern.Collide:GetChildren())do
- if v:IsA("BasePart") then
- v.Size = Vector3.new(v.Size.X,v.Size.Y + 16,v.Size.Z)
- end
- end
- plot.PutGoatinBern(plot1,typee,Data1,Status)
- end
- end
- function plot.ConvertGoat(tab1,Type:string,Convert:string)--=======>Converting Goats
- local amount= 0
- for i,v in pairs(tab1)do
- if v == Type then
- amount +=1
- if amount >= plot.GoatInfo[Convert.." Goat"].Need[Type.." Goat"] then
- for l = plot.GoatInfo[Convert.." Goat"].Need[Type.." Goat"] ,1,-1 do
- local index = table.find(tab1,Type)
- table.remove(tab1,index)
- end
- table.insert(tab1,Convert)
- amount = 0
- plot.ConvertGoat(tab1,Type,Convert)
- end
- end
- end
- if amount<plot.GoatInfo[Convert.." Goat"].Need[Type.." Goat"] then
- return tab1 , true
- end
- end
- function plot.SortTableToHigher(tablee)--=========>Sort Table goat fron lower To Higher
- for i,v in pairs(tablee)do
- tablee[i] = plot.strongestGoat[v]
- end
- table.sort(tablee,function(a,b)
- if a > b then
- return true
- end
- end)
- for i,v in pairs(tablee)do
- for l,m in pairs(plot.strongestGoat)do
- if m ==v then
- tablee[i] = l
- end
- end
- end
- return tablee
- end
- function plot.PutGoatTable(plot1)--==============> Put Current Goat At table
- local tab = {}
- for i,v:Model in pairs(plot1.Bern.Goats:GetChildren())do
- if v:IsA("Model") then
- table.insert(tab,v:GetAttribute("Type"))
- v:Destroy()
- end
- end
- for i,v in pairs(plot1.Bern.Places:GetChildren())do
- if v.Name ~= "Temp1" then
- v:Destroy()
- plot1.Bern.Roof:SetPrimaryPartCFrame(plot1.Bern.Places["Temp1"]:GetPrimaryPartCFrame()* CFrame.new(0,7,0))
- end
- end
- for l,m in pairs(plot1.Bern.Places["Temp1"].Places:GetChildren())do
- if m:IsA("BasePart") then
- m:SetAttribute("IsFull",false)
- end
- end
- plot1.Bern.Places["Temp1"]:SetAttribute("IsFull",false)
- return tab
- end
- function plot.mergeGoats(tab) --=========>merge Table Function
- local tab1,isDone = plot.ConvertGoat(tab,"Normal","Chocolate")
- if isDone then
- local tab2,isDone2 = plot.ConvertGoat(tab1,"Chocolate","Strawberry")
- if isDone2 then
- local tab3,isDone3 = plot.ConvertGoat(tab2,"Strawberry","Mango")
- if isDone3 then
- local tab4,isDone4 = plot.ConvertGoat(tab3,"Mango","Lemon")
- if isDone4 then
- local tab5,isDone5 = plot.ConvertGoat(tab4,"Lemon","Kiwi")
- if isDone5 then
- local tab6,isDone6 = plot.ConvertGoat(tab5,"Kiwi","Silver")
- if isDone6 then
- local tab7,isDone7 = plot.ConvertGoat(tab6,"Silver","Gold")
- if isDone7 then
- local tab8,isDone8 = plot.ConvertGoat(tab7,"Gold","Diamond")
- if isDone8 then
- local tab9,isDone9 = plot.ConvertGoat(tab8,"Diamond","Amethyst")
- if isDone9 then
- local tab10,isDone10 = plot.ConvertGoat(tab9,"Amethyst","Rainbow")
- return tab10 , isDone10
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- function plot:ClaimMilkByPlayer(plot1:Instance,data:Data)--============>Claim Milk Function
- local deb = {}
- local cor = coroutine.create(function()
- while wait(0.002)do
- if not plot1:FindFirstChild("Bern") then break end
- if plot1.Bern.Stopped.Value == true then break end
- for i,v in pairs(plot1.Bern.Milks:GetChildren())do
- if v:IsA("Model") then
- if self.plr:DistanceFromCharacter(v.Part.Position) <= 4.5 and v:GetAttribute("Owner") == self.plr.Name then
- if not deb[self.plr] then
- deb[self.plr] = true
- game.ReplicatedStorage.events.Popup:FireClient(self.plr,v:GetAttribute("Amount"))
- self.plr.leaderstats.Milk.Value += v:GetAttribute("Amount")
- data.Milk = self.plr.leaderstats.Milk.Value
- v:Destroy()
- game.ReplicatedStorage.events.Sound:FireClient(self.plr,"sound")
- --game:GetService("Debris"):AddItem(clone2,0.001)
- for l,m in ipairs(plot1.Bern.Milks:GetChildren())do
- m.Name = "Milk"..l
- end
- plot1.Bern.limitedMode.Value = false
- deb[self.plr] = false
- else
- end
- end
- end
- end
- end
- end)
- coroutine.resume(cor)
- end
- function plot:SetAllSettingsForPlot(plot1,chr)
- plot.LoadingInfoGoatType(plot1)
- local data = Data:Get(self.plr)
- local sell = process.New(self.plr,chr,plot1)
- local tweeninfo = TweenInfo.new(0.2,Enum.EasingStyle.Quint,Enum.EasingDirection.In,0)
- local deb = {}
- local container = plot1.buttons["1Goat"].Zone
- local zone = Zone.new(container)
- local zone2 = Zone.new(plot1.buttons["6Goat"].Zone)
- local zone3 = Zone.new(plot1["Merge Button"].Zone)
- local zone4 = Zone.new(plot1["Sell Button"].Zone)
- local sell1 = Zone.new(plot1.buttons.Speed1Sell)
- local sell10 = Zone.new(plot1.buttons.Speed10Sell)
- local procces1 = Zone.new(plot1.buttons.Speed1Storage)
- local procces10 = Zone.new(plot1.buttons.Speed10Storage)
- local deblimied
- local MilkNumberAnimation = NumberAnimation.new(plot1.CompressorParts.ye.BillboardGui.TextLabel, self.plr.Values.Storage, {
- Style = "Tween",
- Time = 0.4,
- EasingStyle = "Quad",
- EasingDirection = "InOut",
- Abbreviate = false
- })
- --===========================> Loading Data
- plot1.Bern.Stopped.Value = false
- plot1.CompressorParts.holder.BillboardGui.TextLabel.Text = self.plr.Values.Process.Value
- plot1.CompressorParts.ye.BillboardGui.TextLabel.Text = self.plr.Values.Storage.Value
- if data.GoatsInBern then
- if #data.GoatsInBern ~= 0 then
- for i,v in pairs(data.GoatsInBern)do
- plot.PutGoatinBern(plot1,v,data,"Load")
- end
- plot1.buttons["1Goat"].Button.BillboardGui.TextLabel.Text = "Goat +1 $"..self.plr.Values.Price.Value
- plot1.buttons["6Goat"].Button.BillboardGui.TextLabel.Text = "Goat +6 $"..self.plr.Values.Price2.Value
- end
- end
- sell:MilkToStorage(sell,"Load")
- sell:StorageToProcess()
- sell:ProcessToCash()
- plot1.buttons.Speed10Sell.Button.BillboardGui.Price.Text = "$"..550+(self.plr.Values.ProcessSpeed.Value-1)*1000
- plot1.buttons.Speed1Sell.Button.BillboardGui.Price.Text = "$"..20+(self.plr.Values.ProcessSpeed.Value-1)*100
- plot1.buttons.Speed10Sell.Button.BillboardGui.TextLabel.Text = "Speed Sell ("..self.plr.Values.ProcessSpeed.Value..") +10"
- plot1.buttons.Speed1Sell.Button.BillboardGui.TextLabel.Text = "Speed Sell ("..self.plr.Values.ProcessSpeed.Value..") +1"
- plot1.buttons.Speed10Storage.Button.BillboardGui.Price.Text = "$"..1100+(((self.plr.Values.StorageSpeed.Value-5)/10)*40)*10
- plot1.buttons.Speed1Storage.Button.BillboardGui.Price.Text = "$"..20+((self.plr.Values.StorageSpeed.Value/5)*20)
- plot1.buttons.Speed10Storage.Button.BillboardGui.TextLabel.Text = "Speed Processor ("..self.plr.Values.StorageSpeed.Value/5 ..") +10"
- plot1.buttons.Speed1Storage.Button.BillboardGui.TextLabel.Text = "Speed Processor ("..self.plr.Values.StorageSpeed.Value/5 ..") +1"--]]
- --=======================>Events
- plot1.Bern.Milks.ChildAdded:Connect(function(clone2:Model)
- if clone2:IsA("Model") then
- plot1.Bern.Milks:SetAttribute("Milk",#plot1.Bern.Milks:GetChildren())
- clone2:SetAttribute("Owner",self.plr.Name)
- if #plot1.Bern.Milks:GetChildren() >= 70 then
- plot1.Bern.limitedMode.Value = true
- end
- end
- end)
- self.plr.Values.Process.Changed:Connect(function()
- if plot1.Bern.Stopped.Value then return end
- plot1.CompressorParts.holder.BillboardGui.TextLabel.Text = self.plr.Values.Process.Value
- end)
- self.plr.Values.Storage.Changed:Connect(function()
- if plot1.Bern.Stopped.Value then return end
- MilkNumberAnimation:SetPrefix("")
- MilkNumberAnimation:Start()
- end)
- zone.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1.buttons["1Goat"].Name] then
- plot.EnterZone(player,deb,plot1,plot1.buttons["1Goat"])
- if plot1.buttons["1Goat"].Button.BillboardGui.TextLabel.Text == "Free Goat" then
- plot1.Bern.RefreshingMode.Value = false
- plot1.buttons["1Goat"].Button.BillboardGui.TextLabel.Text = "Goat +1 $"..player.Values.Price.Value
- plot1.buttons["6Goat"].Button.BillboardGui.TextLabel.Text = "Goat +6 $"..player.Values.Price2.Value
- player.leaderstats.Goat.Value += 1
- plot.PutGoatinBern(plot1,"Normal",data,"Put")
- plot1.Bern.RefreshingMode.Value = true
- else
- if player.leaderstats.Cash.Value >= player.Values.Price.Value then
- plot1.Bern.RefreshingMode.Value = false
- player.leaderstats.Cash.Value -= player.Values.Price.Value
- player.Values.Price.Value = math.floor(player.Values.Price.Value +20)
- player.Values.Price2.Value = math.floor(player.Values.Price2.Value +120)
- plot1.buttons["1Goat"].Button.BillboardGui.TextLabel.Text = "Goat +1 $"..player.Values.Price.Value
- plot1.buttons["6Goat"].Button.BillboardGui.TextLabel.Text = "Goat +6 $"..player.Values.Price2.Value
- player.leaderstats.Goat.Value += 1
- plot.PutGoatinBern(plot1,"Normal",data,"Put")
- plot1.Bern.RefreshingMode.Value = true
- end
- end
- deb[plot1.buttons["1Goat"].Name]= false
- end
- end
- end)
- zone2.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1.buttons["6Goat"].Name] then
- plot.EnterZone(player,deb,plot1,plot1.buttons["6Goat"])
- if player.leaderstats.Cash.Value >= player.Values.Price2.Value then
- player.leaderstats.Cash.Value -= player.Values.Price2.Value
- plot1.Bern.RefreshingMode.Value = false
- player.leaderstats.Goat.Value += 6
- for i = 6, 1,-1 do
- player.Values.Price.Value = math.floor(player.Values.Price.Value +20)
- plot.PutGoatinBern(plot1,"Normal",data,"Put")
- end
- plot1.Bern.RefreshingMode.Value = true
- player.Values.Price2.Value += 720
- end
- plot1.buttons["6Goat"].Button.BillboardGui.TextLabel.Text = "Goat +6 $"..player.Values.Price2.Value
- plot1.buttons["1Goat"].Button.BillboardGui.TextLabel.Text = "Goat +1 $"..player.Values.Price.Value
- deb[plot1.buttons["6Goat"].Name]= false
- end
- end
- end)
- zone3.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1["Merge Button"].Name] then
- plot.EnterZone(player,deb,plot1,plot1["Merge Button"])
- if #plot1.Bern.Goats:GetChildren() <=0 then
- warn("No Goats at bern")
- else
- local tableee , merge = plot.mergeGoats(plot.PutGoatTable(plot1))
- local tablee = plot.SortTableToHigher(tableee)
- data.GoatsInBern = {}
- if merge then
- for i,v in ipairs(tablee)do
- plot.PutGoatinBern(plot1,v,data,"Put")
- end
- end
- end
- deb[plot1["Merge Button"].Name] = false
- end
- end
- end)
- zone4.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1["Sell Button"].Name] then
- plot.EnterZone(player,deb,plot1,plot1["Sell Button"])
- if player.leaderstats.Milk.Value > 0 then
- sell:MilkToStorage(sell,"any",data)
- end
- deb[plot1["Sell Button"].Name] = false
- end
- end
- end)
- sell1.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1.buttons.Speed1Sell.Name] then
- deb[plot1.buttons.Speed1Sell.Name] = true
- plot.EnterZone(player,deb,plot1,plot1.buttons.Speed1Sell)
- local price = string.gsub(plot1.buttons.Speed1Sell.Button.BillboardGui.Price.Text, "%p", "")
- if self.plr.leaderstats.Cash.Value>= tonumber(price) then
- self.plr.leaderstats.Cash.Value -= tonumber(price)
- self.plr.Values.ProcessSpeed.Value += 1
- plot1.buttons.Speed10Sell.Button.BillboardGui.Price.Text = "$"..550+(self.plr.Values.ProcessSpeed.Value-1)*1000
- plot1.buttons.Speed1Sell.Button.BillboardGui.Price.Text = "$"..20+(self.plr.Values.ProcessSpeed.Value-1)*100
- plot1.buttons.Speed10Sell.Button.BillboardGui.TextLabel.Text = "Speed Sell ("..self.plr.Values.ProcessSpeed.Value..") +10"
- plot1.buttons.Speed1Sell.Button.BillboardGui.TextLabel.Text = "Speed Sell ("..self.plr.Values.ProcessSpeed.Value..") +1"
- end
- deb[plot1.buttons.Speed1Sell.Name] = false
- end
- end
- end)
- sell10.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1.buttons.Speed10Sell.Name] then
- deb[plot1.buttons.Speed10Sell.Name]= true
- plot.EnterZone(player,deb,plot1,plot1.buttons.Speed10Sell)
- local price = string.gsub(plot1.buttons.Speed10Sell.Button.BillboardGui.Price.Text, "%p", "")
- if self.plr.leaderstats.Cash.Value>= tonumber(price) then
- self.plr.leaderstats.Cash.Value -= tonumber(price)
- self.plr.Values.ProcessSpeed.Value += 10
- plot1.buttons.Speed10Sell.Button.BillboardGui.Price.Text = "$"..550+(self.plr.Values.ProcessSpeed.Value-1)*1000
- plot1.buttons.Speed1Sell.Button.BillboardGui.Price.Text = "$"..20+(self.plr.Values.ProcessSpeed.Value-1)*100
- plot1.buttons.Speed10Sell.Button.BillboardGui.TextLabel.Text = "Speed Sell ("..self.plr.Values.ProcessSpeed.Value..") +10"
- plot1.buttons.Speed1Sell.Button.BillboardGui.TextLabel.Text = "Speed Sell ("..self.plr.Values.ProcessSpeed.Value..") +1"
- end
- deb[plot1.buttons.Speed10Sell.Name] = false
- end
- end
- end)
- procces1.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1.buttons.Speed1Storage.Name] then
- deb[plot1.buttons.Speed1Storage.Name] = true
- local price = string.gsub(plot1.buttons.Speed1Storage.Button.BillboardGui.Price.Text, "%p", "")
- plot.EnterZone(player,deb,plot1,plot1.buttons.Speed1Storage)
- if self.plr.leaderstats.Cash.Value>= tonumber(price) then
- self.plr.leaderstats.Cash.Value -= tonumber(price)
- self.plr.Values.StorageSpeed.Value += 5
- plot1.buttons.Speed10Storage.Button.BillboardGui.Price.Text = "$"..1100+(((self.plr.Values.StorageSpeed.Value-5)/10)*40)*10
- plot1.buttons.Speed1Storage.Button.BillboardGui.Price.Text = "$"..20+((self.plr.Values.StorageSpeed.Value/5)*20)
- plot1.buttons.Speed10Storage.Button.BillboardGui.TextLabel.Text = "Speed Processor ("..self.plr.Values.StorageSpeed.Value/5 ..") +10"
- plot1.buttons.Speed1Storage.Button.BillboardGui.TextLabel.Text = "Speed Processor ("..self.plr.Values.StorageSpeed.Value/5 ..") +1"
- end
- deb[plot1.buttons.Speed1Storage.Name] = false
- end
- end
- end)
- procces10.playerEntered:Connect(function(player)
- if plot1:GetAttribute("Owner") == player.Name then
- if not deb[plot1.buttons.Speed10Storage.Name] then
- deb[plot1.buttons.Speed10Storage.Name] = true
- local price = string.gsub(plot1.buttons.Speed10Storage.Button.BillboardGui.Price.Text, "%p", "")
- plot.EnterZone(player,deb,plot1,plot1.buttons.Speed10Storage)
- if self.plr.leaderstats.Cash.Value>= tonumber(price) then
- self.plr.leaderstats.Cash.Value -= tonumber(price)
- self.plr.Values.StorageSpeed.Value += 10 *5
- plot1.buttons.Speed10Storage.Button.BillboardGui.Price.Text = "$"..1100+((self.plr.Values.StorageSpeed.Value-5)/10)*40*10
- plot1.buttons.Speed1Storage.Button.BillboardGui.Price.Text = "$"..20+((self.plr.Values.StorageSpeed.Value-5)/10)*40
- plot1.buttons.Speed10Storage.Button.BillboardGui.TextLabel.Text = "Speed Processor ("..self.plr.Values.StorageSpeed.Value/5 ..") +10"
- plot1.buttons.Speed1Storage.Button.BillboardGui.TextLabel.Text = "Speed Processor ("..self.plr.Values.StorageSpeed.Value/5 ..") +1"
- end
- deb[plot1.buttons.Speed10Storage.Name] = false
- end
- end
- end)
- end
- function plot.ClearPlotOnPlayerLeave(plr)
- for i,v in pairs(workspace.Plots:GetChildren())do
- if v:IsA("Model") then
- if v:GetAttribute("Owner") == plr.Name then
- v.Bern.Stopped.Value = true
- for l,m:BasePart in pairs(v:GetDescendants())do
- if m:IsA("BasePart") then
- m.Transparency = 1
- end
- end
- for l,m in pairs(v.Bern.Milks:GetChildren())do
- m:SetAttribute("Amount",0)
- m:Destroy()
- end
- local clone = game.ServerStorage.Storage.temp:Clone()
- clone.Parent = workspace.Plots
- clone.Name = v.Name
- clone:SetPrimaryPartCFrame(v:GetPrimaryPartCFrame())
- v.Parent = workspace
- clone.Bern.Stopped.Value =true
- wait(1)
- v:Destroy()
- end
- end
- end
- end
- return plot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement