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

PlayerAdded is not a valid member of ServerScriptStorage?

There were many errors in my script I had to fix up. I was capable of fixing all of the errors with no problem until this error came up: PlayerAdded is not a valid member of ServerScriptStorage

As a new scripter, I don't really know what that error message means, and I'm not sure what to do about it.

If someone could explain this error message and what I'm supposed to do about it, please help.

Here's the script:

function rank()
	if newPlayer:IsInGroup(4266272) then
		if Player:GetRankInGroup(255) then 
			print("You are the owner, yay!")
		else 
			print("You aren't the owner..")
	end
	end
	end

script.Parent.PlayerAdded:connect(rank)

I did this script for a little bit of experimenting and testing.

2 answers

✓ Accepted answer

###This is because in the ServerScriptService, there is no event called PlayerAdded. You’re looking for the Players service.

function rank(plr)
    if plr:GetRankInGroup(4266272) == 255 then
        print(plr.Name, "is the owner of the group!")
    end
end

game:GetService("Players").PlayerAdded:Connect(rank)

replace script.Parent in the bottom of the script with game.Players Example

function rank()
if newPlayer:IsInGroup(4266272) then

if Player:GetRankInGroup(255) then
print("You are the owner, yay!")
  else
 print("You aren't the owner..")
end
end

end

	 
game.Players.PlayerAdded:connect(rank)

3 comments

0

No.

0

You still didn’t fix the other code (which had errors), and using game.Players isn’t smart.

0

there goes incapaz thinking that he knows everything lmao

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