Is this the correct way to use find? If not how can I use it?

The code is probably very badly written as i wrote this without testing.

local whitelist = {"PrismaticScripts","Danglt"}  
game.Players.PlayerAdded:Connect(function(player)  
	player.Chatted:Connect(function(msg)  
		if player.Name == #whitelist then  
			if msg:Sub(4):lower() == "age" then  
				for i,v in pairs(game.Players:GetChildren()) do  	
					print(v.find, msg:Sub(5):lower() .. "age is " .. 	v.find(v.find, msg:Sub(5):lower().AccountAge))  
				end
			end  
		end  
	end)  
end)

3 comments

0

I put the code in a code block and fixed the indentation.

0

This might answer that question. https://www.lua.org/pil/20.1.html

0

This question is more subjective than anything else; there is no "correct way" to use it.