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

I keep gettng error player is not a valid member of players?

script.Parent.Touched:connect(function(part)
	if part.Parent and Game:GetService('Players'):GetPlayerFromCharacter(part.Parent) then
		local player = Game:GetService('Players'):GetPlayerFromCharacter(part.Parent)
		print (player)
		if player:GetRankInGroup(3193777) >= 3 then
			script.Parent.Decal.Transparency = 0
			script.Parent.Transparency = 1
			script.Parent.CanCollide = false
			wait(0.8)
			script.Parent.Decal.Transparency = 1
			script.Parent.Transparency = 1
			script.Parent.CanCollide = true
			game.Lighting.TickGUI:Clone().Parent = game.Players["player"].PlayerGui
		end
	end
end)

00:48:59.546 - player is not a valid member of Players

??????

1 answer

game.Players["player"] is looking for a Player in Players with the name "player"... it's not actually making use of your variable. It's looking for a name.

Just use your variable directly, like what you did on line 5. player.PlayerGui

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