Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this is the local script inside the scoreboardgui
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local scoreboard = script.Parent
- local mainFrame = scoreboard:WaitForChild("MainFrame")
- local courtFolder = workspace:WaitForChild("Court2")
- local padsFolder = courtFolder.Main:WaitForChild("Pads")
- local function setScoreboardVisible(visible)
- mainFrame.Visible = visible
- end
- for _, pad in ipairs(padsFolder:GetChildren()) do
- if pad:IsA("BasePart") then
- pad.Touched:Connect(function(hit)
- local hitCharacter = hit.Parent
- if hitCharacter == player.Character then
- setScoreboardVisible(true)
- end
- end)
- pad.TouchEnded:Connect(function(hit)
- local hitCharacter = hit.Parent
- if hitCharacter == player.Character then
- setScoreboardVisible(false)
- end
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment