11-19-2015, 01:30 AM
(This post was last modified: 11-19-2015, 01:31 AM by Gamerboy59.)
I've got now:
Still invalid player.
local addusertofile = function(OtherPlayer) if OtherPlayer:GetName() == Split[3] then friendusername = OtherPlayer:GetUUID() 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 local UUID = cMojangAPI:GetUUIDFromPlayerName(Split[3], true) if (UUID == "" or UUID == nil) then Player:SendMessageFailure("Invalid Playername") return true end local file = io.open(friendDir .. "/friends.txt", "a") file:write(UUID, "\n") file:close() Player:SendMessageSuccess("Friend added. You can check with /friend [playername]") end
Still invalid player.