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

Why am I getting this in my code? ServerScriptService.Events:79: attempt to index nil with 'Value'

local HomeChanger = Folder.ScoreboardControl:WaitForChild("HomeChanger")
local AwayChanger = Folder.ScoreboardControl:WaitForChild("AwayChanger")

HomeChanger.OnServerEvent:connect(function(client, Side, HomeLogo, ABR)
	workspace.GameValues.HomeLogo.Value = HomeLogo
	workspace.GameValues.HomeName.Value = ABR
	game.ServerScriptService.ValueRemoverHome.Turn.Value = true
	wait(1)
	game.Lighting.TeamSelector.Home:FindFirstChild(ABR).Value = true
end)
AwayChanger.OnServerEvent:connect(function(client, Side, AwayLogo, ABR)
	workspace.GameValues.AwayLogo.Value = AwayLogo
	workspace.GameValues.AwayName.Value = ABR
	game.ServerScriptService.ValueRemoverAway.Turn.Value = true
	wait(1)
	game.Lighting.TeamSelector.Away:FindFirstChild(ABR).Value = true
end)

4 comments

1

what line is 79???

0

Which line did it say the error happened?

0

Sorry about that its line 16 on here

0

its probably because game.Lighting.TeamSelector.Away:FindFirstChild(ABR) does not exist could you show a picture of your lighting

1 answer

✓ Accepted answer

the problem is that a boolvalue/string value/number value is nil or undefined on line 79

6 comments

0

How would i define it?

0

maybe if you could the line that would be great

0

its probably because game.Lighting.TeamSelector.Away:FindFirstChild(ABR) does not exist

0

Ah I found the issue so I was changing the value of the (ABR) which was causing a error with the values as the ABR was different then the value name.

0

good job

0

Appreciate the help guys

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