coding_giants

l17 DropsClient2

Mar 21st, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
Add Comment
Please, Sign In to add comment