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

script prints "nil" even though there is something there?

I have 2 text boxes and my script prints one of them but not the other, the "potatoes" is printing fine, but the "name" isn't, could anyone tell me why this would be?

script.Parent.MouseButton1Click:Connect(function()
	local name = script.Parent.Name.Text
	local potatoes = script.Parent.Potatoes.Text
	if name ~= "" and potatoes ~= "" then
		print(tonumber(potatoes))
		print(tostring(name))
		game.ReplicatedStorage.PotatoesCommand:FireServer(name, potatoes)
	end
	
end)

1 comment

0

It means that potatoes is not a number

1 answer

✓ Accepted answer

Try changing script.Parent.Name 's name to something else since it might think you're trying to get the parent's actual name.

1 comment

0

omg thank you so much!

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