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

Error valid member of player?

I am scripting a room giver I have done all the coding that I can possibly do but it says Enter username is not a valid member of Players when I enter their name in the room giver. Heres what I have if you have anything that can help please let me know.

script.Parent.confirm.MouseButton1Click:connect(function()
	if script.Parent.errormsg.Text == "Error: Room not available" then
		warn("Room not available") else
		if game.Players[script.Parent.username.Text] then
		game.ServerStorage.ReceptionSystem.RoomsFolder["Room"..script.Parent.roomnum.Text].Value = true
		local newVal = Instance.new("StringValue", game.ServerStorage.ReceptionSystem.CheckedIn)
		newVal.Name = "Room"..script.Parent.roomnum.Text
		newVal.Value = game.Players[script.Parent.username.Text].Name
		local newKey = game.ServerStorage.ReceptionSystem.Card:Clone()
		newKey.Parent = game.Players[script.Parent.username.Text].Backpack
		newKey.Name = "Room "..script.Parent.roomnum.Text
		newKey.CardNumber.Value = script.Parent.roomnum.Text
		script.Parent.confirm.Text = "Checked in!"
		script.Parent.roomnum.Text = "Enter room number"
		script.Parent.username.Text = "Enter username"
		wait(0.5)
		script.Parent.confirm.Text = "Check-in"
		end
	end	
end)
	
script.Parent.roomnum.Changed:connect(function()
	script.Parent.errormsg.Text = " "
	if game.ServerStorage.ReceptionSystem.CheckedIn["Room"..script.Parent.roomnum.Text] then
		script.Parent.errormsg.Text = "Error: Room not available"
	end
end)

I always get error around line 4

Here is the link for the Screenshot explorer http://www.shorturl.at/eJNV1

2 comments

0

Please put this in a code block. This is very hard to read.

0

Also, do you mind maybe showing the explorer?

1 answer

From my perspective, it seems you are trying to make a textbook that, when you enter a player's username, it gives them a room. If you are getting the username from the textbook, I recommend getting the TextBox.Text, checking if the text in the textbook is a player, then continue your script.

I didn't write code because of not being able to see the explorer, so I don't know what to look for.

Hopefully this helps, as I am fairly new too scripting.

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