Hello. I am currently experiencing an issue with my code. What it says is “the sender must be connected to the current server”
I have tried some stuff but it didn’t seem to work, so i would appreciate any help.
The code is about 6,000 lines long so i will provide a pastebin link with the whole code.
(Error code is happening on line: 833, 184, 3438, 574)
These are only the lines of code i know that this is occuring on, unfortunately there could be a thousand more. I will have to eventually share game’s code.
Sure,
Line 833:
local ret,lobby = game.ReplicatedStorage.Remotes.CreateLobby:InvokeServer(Type,Rules,Deck)
Line 3438:
local Res,ReturnedName = game.ReplicatedStorage.Remotes.RenameDeck:InvokeServer(GameUI.ClientVars.BuildSettings.SelectedDeck.Value,NewName)
Line 574 (doesn’t make any sense):
elseif #GameColors == 2 then
function module:ReNameDeck(PlayerName,DeckName,NewName)
local Data = game.ReplicatedStorage.PlayerData:FindFirstChild(PlayerName)
if Data then
local DeckFind = Data.Inventory.Decks:FindFirstChild(DeckName)
if DeckFind then
local FilteredResult = TextService:FilterStringAsync(NewName,23441688)
local FilterRes = FilteredResult:GetNonChatStringForBroadcastAsync()
if FilterRes ~= NewName then
return "Filtered"
else
local SameName = Data.Inventory.Decks:FindFirstChild(NewName)
if SameName then
local DisName = NewName
local NameCount = 1
local Named = false
repeat
NameCount += 1
DisName = NewName .. " #" .. NameCount
local NextFind = Data.Inventory.Decks:FindFirstChild(DisName)
if NextFind then
--
else
Named = true
end
until Named
DeckFind.Name = DisName
return "Good",DisName
else
DeckFind.Name = NewName
return "Good",NewName
end
end
end
end
return "Bad"
end
It underscored “newname” with the warning Type Error: (184,56) Unknown global ‘NewName’ after putting
local FilteredResult = TextService:FilterStringAsync(NewName,Player.UserId)
(i made a local Player = game:GetService(“Players”).LocalPlayer)
I think you removed the :ReNameDeck function from it
function module:CreateLobby(PlayerName,Type,Args,Deck)
if self:IsInLobby(PlayerName) or self:IsInGame(PlayerName) or self:IsSpectating(PlayerName) then return "Failed" end
if Args["CodeLocked"] then
local Code = Args["Code"]
local FilteredResult = TextService:FilterStringAsync(NewName,Player.UserId)
local FilterRes = FilteredResult:GetNonChatStringForBroadcastAsync()
if FilterRes ~= Code then
return "Filtered"
end
end
...
end
I believe you want this little bit to have
if Args["CodeLocked"] then
local Code = Args["Code"]
local FilteredResult = TextService:FilterStringAsync(Args["Code"],Player.UserId)
local FilterRes = FilteredResult:GetNonChatStringForBroadcastAsync()
if FilterRes ~= Code then
return "Filtered"
end
end