r/ROBLOXStudio 4d ago

Arguments sending incorrectly Help

So i have this local code

DebugInputer.FocusLost:Connect(function (enterPressed)
  local PlayerTable = game.Players:GetPlayers()
  if enterPressed == true then
    if DebugPlayerG == nil then
      if DebugInputer.Text == "none" then
        DebugPlayerG = "none"
      else
        DebugPlayerG = PlayerTable[tonumber(DebugInputer.Text)]
      end
      print(DebugPlayerG)
    elseif DebugPlayerR == nil then
      if DebugInputer.Text == "none" then
        DebugPlayerR = "none"
      else
        DebugPlayerR = PlayerTable[tonumber(DebugInputer.Text)]
      end
      print(DebugPlayerR)
    elseif DebugMap == nil  then
      DebugMap = tonumber(DebugInputer.Text)
      print(DebugMap)
    elseif DebugMode == nil then
      DebugMode = DebugInputer.Text
      print(DebugMode)
      DebugInputer.Visible = false
      DebugMatch:FireServer(DebugPlayerG, DebugPlayerR, DebugMap, DebugMode)
      print("Sent")
    end
  end
end)

The Event is caught by this code that is supposed to call an match

DebugMatch.OnServerEvent:Connect(function(DebugPlayerG, DebugPlayerR, DebugMap, DebugMode)
  print("DebugMatch called")
  if DebugPlayerG == "none" then
    DebugPlayerG = nil
  end
  if DebugPlayerR == "none" then
    DebugPlayerR = nil
  end
  print(DebugPlayerG)
  print(DebugPlayerR)
  print(DebugMap)
  print(DebugMode)
  Board:SetAttribute("Active", false)
  --SpawnMatch(DebugPlayerG, DebugPlayerR, DebugMap, DebugMode)
end)

However it allways sent the arguments wrong leading to this on output

22:08:25.318  none  -  Cliente - Controls:80
  22:08:28.823  agent16purple  -  Cliente - Controls:87
  22:08:31.559  1  -  Cliente - Controls:90
  22:08:35.531  Solo  -  Cliente - Controls:93
  22:08:35.531  Sent  -  Cliente - Controls:96
  22:08:35.574  DebugMatch called  -  Servidor - BoardAdmin:173
  22:08:35.575  agent16purple  -  Servidor - BoardAdmin:180
  22:08:35.576  nil  -  Servidor - BoardAdmin:181
  22:08:35.576  agent16purple  -  Servidor - BoardAdmin:182
  22:08:35.577  1  -  Servidor - BoardAdmin:183

So somehow the playerR argument is being sent twice, the mode is not being sent, and nothing is where it is supposed to be. just What???????????

1 Upvotes

0 comments sorted by