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

Error PlayerScripts is not a valid member of player?

repeat
	wait()
until game.Workspace.Gravity < 1000
while wait() do
wait(8)
	local Plate = game.Workspace.Plates:FindFirstChild(game.Players:FindFirstChild(script.Parent.Name).PlayerScripts.Nani.Value ..'Plate')
if Plate then
		script.Parent.HumanoidRootPart.Position = Plate.Position + Vector3.new(0,10,0)
	end
	repeat
	wait()
	until script.Parent.Humanoid.Health == 0	
end

1 answer

The error means that the folder PlayerScripts does not exist when you are trying to get it. Try changing to :WaitForChild() or divide your reference, like:

local Plate
if game.Players:FindFirstChild(script.Parent.Name) then
	if game.Players[script.Parent.Name]:FindFirstChild("PlayerScripts") then
		Plate = game.Players[script.Parent.Name].PlayerScripts.Nani.Value..'Plate'
	else print("There is no PlayerScript yet") end
else print("There is no", script.Parent.Name) end

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