View difference between Paste ID: PWNBPrxc and VG8aqxma
SHOW: | | - or go back to the newest paste.
1
-- We scroll down to the updateDamage function and look for the loop
2
for i, item in pairs(drop:GetChildren()) do
3
                    if item.Name == "Reward" then
4
                        remotes.Bank:FireServer("+", item.Value, item.Amount.Value)
5
                    end
6
                end
7
-- Here begins the new code
8
                local lucky = false -- preparing for UX
9
                local reward = 0
10
                local random = math.random(1,100)
11
                local loot = require(drops.Loot)
12
                local name = drop.Name
13
                local shardDrop = loot.drop
14
                for i, v in pairs(shardDrop) do
15
                    if name == i then
16
                        if v.chance >= random then
17
                            reward = v.reward
18
                            remotes.Shards:FireServer(reward)
19
                            lucky = true -- preparing for UX
20
-- after writing the line below, we look for the destroyDrop function and add the same parameters (lucky, reward) as in this bracket
21
                            destroyDrop(drop, lucky, reward)
22
                            break
23
                        else
24
                            destroyDrop(drop)
25
                        end
26
                    end
27
                end
28
-- Here ends the new code
29
                --  remove the line below
30
                destroyDrop(drop)
31