I'm trying to create a script (I'm new at scripting) and I'm trying to make it so if you're a janitor you can check the ph level of a pool, this is the script I have for it: brick = script.Parent guiText = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextBox.Text localTeam = script.Parent.Parent.Parent.Teams.Janitors phLevel = script.Parent.PHLevel.Value function onClicked(playerWhoClicked) if localTeam == true then print(phLevel) end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
(It's not organized yet because I'm just testing everything)

1 comment
What is 'script.Parent.Parent.Parent.Teams.Janitors'? Is it an actual team instance? If so you need to check if it's TeamColor is the same as the TeamColor of the player.