SHOW:
|
|
- or go back to the newest paste.
| 1 | -- We add this line to the end of the variables at the beginning of the code | |
| 2 | local UX = ReplicatedStorage.UserExperience | |
| 3 | -- Further code up to the function | |
| 4 | local function destroyDrop(drop) | |
| 5 | task.spawn(function() | |
| 6 | local oldParent = drop.Parent | |
| 7 | drop.Parent = despawnedDrops | |
| 8 | -- New code | |
| 9 | if drop.Name == "BigChest" then | |
| 10 | local counter = UX.Counter | |
| 11 | local text = counter.CounterDisplay.CounterFrame.CounterText | |
| 12 | local spawnTime = 10 | |
| 13 | counter.Position = drop:FindFirstChildWhichIsA("MeshPart").Position
| |
| 14 | counter.Parent = oldParent | |
| 15 | for zegar = 0, spawnTime do | |
| 16 | local timer = spawnTime - zegar | |
| 17 | local minutes = math.floor(timer/60) | |
| 18 | local seconds = timer%60 | |
| 19 | if minutes >= 10 then | |
| 20 | if seconds >= 10 then | |
| 21 | text.Text = "The chest will respawn in " .. minutes ..":".. seconds | |
| 22 | else | |
| 23 | text.Text = "The chest will respawn in " .. minutes .. ":0" .. seconds | |
| 24 | end | |
| 25 | else | |
| 26 | if seconds >= 10 then | |
| 27 | text.Text = "The chest will respawn in 0" .. minutes .. ":" .. seconds | |
| 28 | else | |
| 29 | text.Text = "The chest will respawn in 0" .. minutes .. ":0" .. seconds | |
| 30 | end | |
| 31 | end | |
| 32 | wait(1) | |
| 33 | end | |
| 34 | counter.Parent = UX | |
| 35 | else | |
| 36 | wait(4) -- Przeniesione z linijki niżej | |
| 37 | end | |
| 38 | -- End of the new code | |
| 39 | drop.CurrentPoints.Value = drop.MaxPoints.Value | |
| 40 | drop.Parent = oldParent | |
| 41 | end) | |
| 42 | end |