Guest User

123131231

a guest
Jan 11th, 2026
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. this is the local script inside the scoreboardgui
  2. local Players = game:GetService("Players")
  3. local player = Players.LocalPlayer
  4. local character = player.Character or player.CharacterAdded:Wait()
  5.  
  6. local scoreboard = script.Parent
  7. local mainFrame = scoreboard:WaitForChild("MainFrame")
  8.  
  9.  
  10. local courtFolder = workspace:WaitForChild("Court2")
  11. local padsFolder = courtFolder.Main:WaitForChild("Pads")
  12.  
  13.  
  14. local function setScoreboardVisible(visible)
  15. mainFrame.Visible = visible
  16. end
  17.  
  18.  
  19. for _, pad in ipairs(padsFolder:GetChildren()) do
  20. if pad:IsA("BasePart") then
  21. pad.Touched:Connect(function(hit)
  22. local hitCharacter = hit.Parent
  23. if hitCharacter == player.Character then
  24. setScoreboardVisible(true)
  25. end
  26. end)
  27.  
  28. pad.TouchEnded:Connect(function(hit)
  29. local hitCharacter = hit.Parent
  30. if hitCharacter == player.Character then
  31.  
  32. setScoreboardVisible(false)
  33. end
  34. end)
  35. end
  36. end
  37.  
Advertisement
Add Comment
Please, Sign In to add comment