View difference between Paste ID: ceWz7bUG and Ff2JaqUV
SHOW: | | - or go back to the newest paste.
1
-- Previous code up to the destroyDrop function
2
-- added lucky and reward as function parameters
3
local function destroyDrop(drop, lucky, reward)
4
    task.spawn(function()
5
   	 local oldParent = drop.Parent
6
   	 drop.Parent = despawnedDrops
7
-- New code appears here
8
   	 task.spawn(function()
9
   		 if lucky == true then
10
   			 local luck = UX.Luck:Clone()
11
   			 local luckText = luck.LuckDisplay.LuckFrame.LuckText
12
   			 local mesh = drop:FindFirstChildWhichIsA("MeshPart")
13
   			 luck.Position = mesh.Position
14
   			 luckText.Text = "Lucky Find! +" .. reward .. " Shards!"
15
   			 luck.Parent = oldParent    
16
   			 wait(5)
17
   			 luck:Destroy()
18
   		 end
19
   	 end)
20
 -- Here ends the new code
21
       	if drop.Name == "BigChest" then
22