Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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?

01d=true
02script.Parent.Parent.Touched:connect(function(hit)
03    if d and hit.Parent:FindFirstChild("Humanoid") and script.Parent.Parent.BrickColor~=BrickColor.Green() then
04        d=false
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
16        wait(2)
17        script.Parent._TeamRing.Disabled=true
18        d=true
19    end
20end)

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?

0
Is that value a NumValue, IntValue, StringValue or BoolValue? fahmisack123 385 — 8y
0
StringValue, but I figured out. Resplendid 3 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Double Check the type of Value you're changing. If you have a BoolValue, the Value can only be true or false. A NumValue can have any number but IntValues must only be integers (Whole numbers). StringValues are just like names, Anyting between two speechmarks are strings.

Make sure that on Line 9, 10, 11 and 14 are using the correct values..

Ad

Answer this question