Answered by
7 years ago Edited 7 years ago
Your first line is wrong, as I can see an easy error:
1 | brick = script.Parent guiText = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextBox.Text localTeam = script.Parent.Parent.Parent.Teams.Janitors phLevel = script.Parent.PHLevel.Value |
This tries to do too much I can't even understand it.
Try this instead [I hope]
01 | local brick = script.Parent.gui |
02 | brick.Text = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextBox.Text |
04 | local Team = game.Players.LocalPlayer.Team |
05 | local phLevel = script.Parent.PHLevel.Value |
08 | if Team = = "Janitor" then |
11 | print ( "Not on the Janitor team" ) |
13 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
Some info:
Make sure your script is a LocalScript. This is because it's just easier to work with when using Guis. If you use FE, be sure to add some RemoteEvents and then you'll be able to run server things like updating DataStores [for money] and whatnot.
If you need any help, I'm Reece#4504 on Discord.