What's wrong with getting the UUID in this function?
#1
Hi,
I'm about getting the UUID of a user to add them to a text file. It somehow doesn't work. :/

	local addusertofile = function(OtherPlayer)
		if OtherPlayer:GetName() == Split[3] then
			if OtherPlayer:GetUUID() == nil or OtherPlayer:GetUUID() == "" then
				friendusername = cMojangAPI:GetUUIDFromPlayerName(Split[3], true)
			else
				friendusername = OtherPlayer:GetUUID()
			end
			local file = io.open(friendDir.."\\friends.txt", "a")
			file:write(friendusername.."\n")
			file:close()
			Player:SendMessageSuccess("Friend added. You can check with /friend [playername]")
		else
			Player:SendMessageFailure("Fail")
		end
	end
	if not cRoot:Get():FindAndDoWithPlayer(Split[3], addusertofile) then
		Player:SendMessageFailure("Invalid Playername")
	end
	end

=> Always says "Invalid Playername" ingame so FindAndDoWith... was not successfull?!
Reply
Thanks given by:


Messages In This Thread
What's wrong with getting the UUID in this function? - by Gamerboy59 - 11-18-2015, 10:05 PM



Users browsing this thread: 1 Guest(s)