I am attempting to put a players unit number on a license plate of a vehicle, the value of the players unit number is located in ServerScriptService under a couple of folders.
I have tried to locate the driveseat and get the occupant of the driveseat, but it seems to give me an error.
Here is my script:
local characterValues = game.ServerScriptService.GameManager.CharacterScripts.ESCharacterValues
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.DriveSeat.Occupant.Parent
local character = characterValues:FindFirstChild(player.Name)
local plate = character.UnitNumber.Value
for i,v in pairs(script.Parent.Plates:GetChildren()) do
v.SGUI.Identifier.Text = plate
end
Here is the error:
Workspace.Model.DPS-1-3.Body.Model.License Plates.LicensePlate.Plate.LicensePlateGenerator:4: attempt to index nil with 'Parent'