Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

"invalid key type used" error?

Asked by 4 years ago

I'm getting an error which is resulting in my teleporting not functioning. Any ideas?

SCRIPT IN SERVERSCRIPTSERVICE

local access = teleportService:ReserveServer(player2Game)
local players = {player}
for i,friend in pairs(friendsOnline) do
    if friend.PlaceId == game.PlaceId and friend.GameId == game.JobId then
        local friendPLR = game.Players:FindFirstChild(friend.UserName)
        game.Workspace.friendSend:FireAllClients(friendPLR,player)
        game.Workspace.friendSend.onServerEvent:Connect(function(suspectPLR)
            if suspectPLR == friendPLR then
                players[i] = game.Players:FindFirstChild(friend.UserName)
            end
        end)
    end
end
wait(4.5)
teleportService:TeleportToPrivateServer(player2Game,access,players)

LOCALSCRIPT IN STARTERPLAYERSCRIPTS

repeat wait() until game.Players.LocalPlayer
game.Workspace.sendFriend.OnClientEvent:Connect(function(player,sent)
    if game.Players.LocalPlayer == player then
        local clone = game.ReplicatedStorage.JoinB:Clone()
        clone.Parent = player.PlayerGui.Priiv
        clone.label.Text = sent.Name.." is starting a room!"
        wait(4)
        if clone.Value.Value == "string" then
            clone:Destroy()
            player.PlayerGui.Priiv.Enabled = false
            game.Workspace.sendFriend:FireServer()
        end
    end
end)
0
Which line is the error? MythsList 38 — 4y
0
^ fortesss7 40 — 4y
0
^ Filipalla 504 — 4y
0
^^ royaltoe 5144 — 4y

Answer this question