Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- for k, v in pairs(playerBlock) do
- local player = k
- local part = playerBlock[k]
- if part ~= nil and part.Parent ~= nil then
- local playerData = dataManager.playerData(k)
- local shrinkRay = enums.ShrinkRays[playerData.Stats["SHRINKRAY"]]
- local model = part.Parent
- if model:FindFirstChild("CurrentAmount") then
- local petAddition = 0
- for k, v in pairs(playerData.Pets) do
- if v.Equipped == true then
- petAddition = petAddition + enums.Pets[v.Pet].InitialAmount
- end
- end
- local currentAmount = model.CurrentAmount.Value
- local maxAmount = model.MaxAmount.Value
- local oldAmount = currentAmount
- currentAmount = currentAmount-((waitTime*(shrinkRay.Amount+petAddition))/shrinkRay.Time)
- model[player.Name].Value = model[player.Name].Value + ((waitTime*(shrinkRay.Amount+petAddition))/shrinkRay.Time)
- model.CurrentAmount.Value = currentAmount
- local ratio = (currentAmount/maxAmount)
- local subtract = model.Subtract.Value
- model.CurrentAmountDisplay.Value = currentAmount-subtract
- model.MaxAmountDisplay.Value = maxAmount-subtract
- local spawning = workspace.Sectors[part.Parent.Name].PrimaryPart
- local yPlatform = spawning.Position.Y+(spawning.Size.Y/2)
- if model.CurrentAmountDisplay.Value > 0 then
- model:SetPrimaryPartCFrame(CFrame.new(Vector3.new(part.Position.X, yPlatform+(model:GetExtentsSize().Y/2), part.Position.Z)))
- local nextOne = currentAmount / oldAmount
- ScaleModel(model, nextOne)
- else
- playerData.Backpack.OBJECTS = playerData.Backpack.OBJECTS + backpackAmount
- local maxAmount = enums.Backpacks[playerData.Stats.BACKPACK].Size
- if playerData.Backpack.OBJECTS > maxAmount then
- playerData.Backpack.OBJECTS = maxAmount
- end
- model:Destroy()
- end
- end
- end
- end
- wait(waitTime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement