zayzaaa2030

Untitled

Sep 27th, 2022
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. local RunService = game:GetService("RunService")
  2. local StarterGui = game:GetService("StarterGui")
  3. local Players = game:GetService("Players")
  4.  
  5. coroutine.resume(coroutine.create(function()
  6. -- Let me know if this function causes performance issues (it shouldn't since it's in a separate thread)
  7. RunService.Stepped:Connect(function()
  8. pcall(function()
  9. -- These variables will nil when you reset so we put them here.
  10. local LocalPlayer = Players.LocalPlayer
  11. local character = LocalPlayer.Character
  12. local PlayerGui = LocalPlayer.PlayerGui
  13. if (character:FindFirstChild("Shotty") or character:FindFirstChild("Glock") or character:FindFirstChild("Sawed Off") or character:FindFirstChild("Uzi")) then
  14. if (PlayerGui:FindFirstChild("ScreenGui")) then
  15. PlayerGui:FindFirstChild("ScreenGui"):Destroy()
  16. end
  17. else
  18. if (not PlayerGui:FindFirstChild("ScreenGui")) then
  19. local ScreenGuiCpy = StarterGui:FindFirstChild("ScreenGui"):Clone()
  20. ScreenGuiCpy.Parent = PlayerGui
  21. end
  22. end
  23. end)
  24. end)
  25. end))
Add Comment
Please, Sign In to add comment