Advertisement
LawMixer

LocalScript

Oct 9th, 2021
1,397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.49 KB | None | 0 0
  1. -- beginning of the credit handler where the modifying credits if the player is in the group or not
  2.  
  3. -- CreditHandler
  4. -- Bulldo344
  5. -- Created on August 24, 2021
  6.  
  7.  
  8.  
  9.  
  10. -- services & locations
  11. local Player = game.Players.LocalPlayer
  12. local Credits = Player:WaitForChild("Data"):WaitForChild("Credits")
  13. local RunService = game:GetService("RunService")
  14. local Notification = game.ReplicatedStorage.Notification.NotificationUI
  15.  
  16. -- functions
  17. script.Parent.CreditTex.TextLabel.Text = "Credits: " .. Credits.Value
  18.  
  19. function Update()
  20.    
  21.     script.Parent.CreditTex.TextLabel.Text = "Credits: " .. Credits.Value
  22.     Notification.Frame.Frame.Text.Text = "Gave you credits & updated them them for you!"
  23.     Notification.Enabled = true
  24.     Notification.Parent = Player.PlayerGui
  25. end
  26.  
  27. function addCred()
  28.    
  29.     --if RunService:IsStudio() then
  30.     --  return
  31.     --end
  32.    
  33.     while task.wait(5) do
  34.         if Player:IsInGroup(00) then
  35.             Player:WaitForChild("Data"):WaitForChild("Credits").Value += 100
  36.             Update()
  37.             print("Updated & Given people that are in the group their credits every 1 minute. [InGroup]")
  38.             task.wait(5)
  39.             Notification.Enabled = false
  40.         else
  41.             Player:WaitForChild("Data"):WaitForChild("Credits").Value += 50
  42.             Update()
  43.             print("Updated & Given people that are not in the group their credits every 1 minute.")
  44.             task.wait(5)
  45.             Notification.Enabled = false
  46.         end
  47.     end
  48. end
  49.  
  50. addCred()
  51. Update()
  52. -- ending of the credit handler where the modifying credits if the player is in the group or not
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement