Advertisement
Cakey3101

Part 12 - Rebirth Handler Script (UPDATED)

Jun 9th, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | Source Code | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local Player = Players.LocalPlayer
  4.  
  5. local Buttons = script.Parent.Parent.Left
  6. local Rebirths = script.Parent.Parent.Rebirths
  7.  
  8. local OpenButton = Buttons.Frame.Rebirths
  9. local ExitButton = Rebirths.Frame.Exit
  10.  
  11. local Amount = Rebirths.Frame.Amount
  12. local RebirthButton = Rebirths.Frame.Rebirth
  13.  
  14. local GuiHandler = require(script.Parent.Controllers.GuiHandler)
  15.  
  16. OpenButton.MouseButton1Click:Connect(function()
  17.     Rebirths.Frame.Visible = true
  18.     Rebirths.Frame:TweenSize(UDim2.fromScale(0.5, 0.65), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.1)
  19.     wait()
  20.     GuiHandler.BlurAllGuis()
  21.     wait(0.01)
  22.     Rebirths.Enabled = true
  23. end)
  24.  
  25. ExitButton.MouseButton1Click:Connect(function()
  26.     Rebirths.Frame:TweenSize(UDim2.fromScale(0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.1)
  27.     wait(0.1)
  28.     Rebirths.Frame.Visible = false
  29.     wait()
  30.     GuiHandler.UnBlurGuis()
  31. end)
  32.  
  33.  
  34. RebirthButton.MouseButton1Click:Connect(function()
  35.     if ((Player.leaderstats.Rebirths.Value * 1000) + 500) * 1.35 <= Player.Points.Value then
  36.         workspace.Remotes.RebirthPlayer:FireServer()
  37.     end
  38. end)
  39.  
  40. while wait(0.1) do
  41.     if ((Player.leaderstats.Rebirths.Value * 1000) + 500) * 1.35 <= Player.Points.Value then
  42.         Amount.Text = "You Have Enough Points To Rebirth!"
  43.     else
  44.         Amount.Text = "You Need "..((Player.leaderstats.Rebirths.Value * 1000) + 500) * 1.35 - Player.Points.Value.." More Points To Rebirth!"
  45.     end
  46. end
Tags: lua
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement