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 7 years ago
Edited 7 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?

d=true
script.Parent.Parent.Touched:connect(function(hit)
    if d and hit.Parent:FindFirstChild("Humanoid") and script.Parent.Parent.BrickColor~=BrickColor.Green() then
        d=false
        local plr=game.Players:FindFirstChild(hit.Parent.Name)
        hit.Parent.Humanoid.WalkSpeed=0
        hit.Parent.Torso.CFrame=CFrame.new(script.Parent.Parent.tpspot.Position)
        script.Parent.Parent.BrickColor=BrickColor.Green()
        plr.Court.Value=script.Parent.Parent.Parent.Parent.Name
        plr.Pad.Value="_Pad"..script.Parent.Parent.Values._PadValue.Value
        script.Parent.Parent.Values._PadTaken.Value=true script.Parent.Parent.Parent.Parent._Scoreboard.Scoreboard:Clone().Parent=plr.PlayerGui
        script.Parent.Parent.Gui.Exit:Clone().Parent=plr.PlayerGui
        script.Parent.Parent.SurfaceGui.TextLabel.Text=hit.Parent.Name
        plr.Team.Value = "Home"
        script.Parent._TeamRing.Disabled=false
        wait(2)
        script.Parent._TeamRing.Disabled=true
        d=true
    end
end)

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 — 7y
0
StringValue, but I figured out. Resplendid 3 — 7y

1 answer

Log in to vote
0
Answered by 7 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