Tweak16

ROBLOX Scripting | Client Gui Script | Skip Stage Checkpoints

Jan 23rd, 2021 (edited)
2,801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. --[[
  2. Made by Tweakified, Neonblox Games
  3. Video: https://www.youtube.com/watch?v=Yki2Y-IuNnA
  4. Server Script: https://pastebin.com/7xCdMs9U
  5.  
  6. Script Type: Local Script
  7. Script Parent: TextButton
  8. --]]
  9.  
  10. local TextButton = script.Parent
  11. local Checkpoints = workspace:WaitForChild("Checkpoints")
  12.  
  13. local Players = game:GetService("Players")
  14. local player = Players.LocalPlayer
  15. local StageLeaderstat = player:WaitForChild("leaderstats"):WaitForChild("Stage")
  16.  
  17. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  18. local SkipStage = ReplicatedStorage:WaitForChild("SkipStage")
  19.  
  20. TextButton.MouseButton1Click:Connect(function()
  21.     if TextButton.Text == "Skip Stage" then
  22.         if #Checkpoints:GetChildren() ~= StageLeaderstat.Value then
  23.             TextButton.Text = "Purchasing..."
  24.             local Response = SkipStage:InvokeServer()
  25.             TextButton.Text = Response
  26.         else
  27.             TextButton.Text = "You have reached the highest stage!"
  28.         end
  29.         wait(2)
  30.         TextButton.Text = "Skip Stage"
  31.     end
  32. end)
Add Comment
Please, Sign In to add comment