Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When touch brick, it's supposed to change the value but comes out nil?

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?

2 comments

0

Is that value a NumValue, IntValue, StringValue or BoolValue?

0

StringValue, but I figured out.

1 answer

✓ Accepted answer

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..

This discussion is preserved as it was. New answers, comments, and votes are closed.