When touch brick, it's supposed to change the value but comes out nil?
Asked by
8 years ago Edited 8 years ago
Hey, basically I touch this pad, and when it touches the pad, in the script, the "Team" Value goes in output printing out saying it's nil, when I don't really know why. Please help?
02 | script.Parent.Parent.Touched:connect( function (hit) |
03 | if d and hit.Parent:FindFirstChild( "Humanoid" ) and script.Parent.Parent.BrickColor~ = BrickColor.Green() then |
05 | local plr = game.Players:FindFirstChild(hit.Parent.Name) |
06 | hit.Parent.Humanoid.WalkSpeed = 0 |
07 | hit.Parent.Torso.CFrame = CFrame.new(script.Parent.Parent.tpspot.Position) |
08 | script.Parent.Parent.BrickColor = BrickColor.Green() |
09 | plr.Court.Value = script.Parent.Parent.Parent.Parent.Name |
10 | plr.Pad.Value = "_Pad" ..script.Parent.Parent.Values._PadValue.Value |
11 | script.Parent.Parent.Values._PadTaken.Value = true script.Parent.Parent.Parent.Parent._Scoreboard.Scoreboard:Clone().Parent = plr.PlayerGui |
12 | script.Parent.Parent.Gui.Exit:Clone().Parent = plr.PlayerGui |
13 | script.Parent.Parent.SurfaceGui.TextLabel.Text = hit.Parent.Name |
14 | plr.Team.Value = "Home" |
15 | script.Parent._TeamRing.Disabled = false |
17 | script.Parent._TeamRing.Disabled = true |
Just read the part during above the plr.Team.Value = "Home" to find out why it makes that value nil.
I think it's cause it's grabbing the players actual Team, not like the value, please help here it dont grab the players actual Team, and get the value?