Hi,
I'm about getting the UUID of a user to add them to a text file. It somehow doesn't work. :/
=> Always says "Invalid Playername" ingame so FindAndDoWith... was not successfull?!
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?!