I just cant understand what is wrong with it, there is an error, it is marked at --
function findPlayer(name) for _, player in pairs(game.Players:GetPlayers()) do if player.Name:lower() == name:lower() then return player return true end -- 'end' expected(to close 'if' at line 3 near 'return end end end
I don't think your able to do that. :P Do this instead;
function findPlayer(plr) --Our function for i,v in pairs(game.Players:GetPlayers()) do --Gets all the players that are currently in game.Players if v.Name:lower():find(plr:lower()) then --If the function matches plr to the Player's name then return v --It'll return the player end --The end to end the 'if' statement end --The end to end the code for the 'for' loop return nil --Will return nil end --The end to end the function
Hope this helped!