Advertisement
MisterH_t

Exchange Button

Jun 12th, 2022
1,120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local c1 = plr.leaderstats.Points
  3. local c2 = plr.leaderstats.Rebirths
  4. local ac = plr.PlayerGui.rebirths_ui.annoucement
  5.  
  6. function onClicked()
  7.     if c1.Value >= 500 then
  8.         print(plr.Name.." has rebirthed!")
  9.         c2.Value = c2.Value +1
  10.         c1.Value = c1.Value -500
  11.     elseif c1.Value <= 500 then
  12.         print(plr.Name.." hasn't enough Points to Rebirth")
  13.         ac.Visible = true
  14.         wait(2)
  15.         ac.Visible = false
  16.     end
  17. end
  18. plr.PlayerGui.rebirths_ui.exchange.MouseButton1Click:Connect(onClicked)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement