My game fixed today

My game it’s not working error please guys if you can help me can I have so I can I join the game do you know that about something I have when I go to on Roblox did you it’s coming to me studio I made news game

Can you provide the entire error message?

Yeah that’s my game is how is the problem but I start working on the map
The military unknown error

I’m not exactly sure I’m following what you mean here or understanding what you’re saying. Is this a error you’re getting in the output? What’s happening?

attention people unn… a colour… date is… i havin a… having error… look at… the… the uhhhh output
serious note, you need to provide us clear detail on your problem or no one is gonna help

4 Likes

Yeah I know that is the problem with my game is coming of Roblox maybe it’s broken that my game is not working so I know what is having a problem l know

show us the error on the output + code in question

2 Likes
  1. local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
  2. local TextService = game:GetService(“TextService”)
  3. local Players = game:GetService(“Players”)
  4. – Define remotes for communication with client
  5. local Remotes = Instance.new(“Folder”, ReplicatedStorage)
  6. Remotes.Name = “PetNamingRemotes”
  7. local UserNamedPet = Instance.new(“RemoteEvent”, Remotes)
  8. UserNamedPet.Name = “UserNamedPet”
  9. –[[
  10. RemoteEvent UserNamedPet
    
  11. Paramaters: petName (string)
    
  12. To be fired by the client when the user has picked a name for their pet.
    
  13. Example:
    
  14. local userNamedPet = ReplicatedStorage:WaitForChild("PetNamingRemotes"):WaitForChild("UserNamedPet")
    
  15. userNamedPet:FireServer("Max")
    
  16. ]]
  17. local SendPetName = Instance.new(“RemoteEvent”, Remotes)
  18. SendPetName.Name = “SendPetName”
  19. –[[
  20. RemoteEvent SendPetName
    
  21. Paramaters: userId (int), petName (string)
    
  22. Fired by the server when a user changes their pet's name
    
  23. Example:
    
  24. local sendPetName = ReplicatedStorage:WaitForChild("PetNamingRemotes"):WaitForChild("SendPetName")
    
  25. sendPetName.OnClientEvent:Connect(function(userId, petName)
    
  26. 	local player = Players:GetPlayerByUserId(userId)
    
  27. 	if player then
    
  28. 		print(player.Name.." has named their pet ".. petName)
    
  29. 	end	
    
  30. end)
    
  31. ]]
  32. local RequestAllPetNames = Instance.new(“RemoteFunction”, Remotes)
  33. RequestAllPetNames.Name = “RequestAllPetNames”
  34. –[[
  35. RemoteEvent SendPetName
    
  36. Paramaters: n/a
    
  37. Fetches the names of every player's pet. To be invoked by the client when a user joins the game. 
    
  38. Example:
    
  39. local requestAllPetNames = ReplicatedStorage:WaitForChild("PetNamingRemotes"):WaitForChild("RequestAllPetNames")
    
  40. local petNames = requestAllPetNames:InvokeServer()
    
  41. for userId, petName in pairs(petNames or {}) do
    
  42. 	local player = Players:GetPlayerByUserId(userId)
    
  43. 	if player then
    
  44. 		print(player.Name.." has a pet named ".. petName)
    
  45. 	end	
    
  46. end
    
  47. ]]
  48. local filterResults = {}
  49. local function broadcastPetName(userId)
  50. local filterResult = filterResults[userId]
    
  51. if filterResult then
    
  52. 	for _, player in pairs(Players:GetPlayers()) do 
    
  53. 		if player then
    
  54. 			-- spawn a new thread so as to not yield the update
    
  55. 			spawn(function()
    
  56. 				-- grab the filtered string for this user
    
  57. 				local toUserId = player.UserId
    
  58. 				local filteredString = filterResult:GetNonChatStringForUserAsync(toUserId)
    
  59. 				filteredString = filteredString or ""
    
  60. 				-- send the remote event
    
  61. 				SendPetName:FireClient(player, userId, filteredString)
    
  62. 			end)
    
  63. 		end
    
  64. 	end
    
  65. end
    
  66. end
  67. UserNamedPet.OnServerEvent:Connect(function(player, petName)
  68. local fromUserId = player.UserId
    
  69. -- pcall to catch errors
    
  70. local success, result = pcall(function()
    
  71. 	return TextService:FilterStringAsync(
    
  72. 		petName, 
    
  73. 		fromUserId
    
  74. 	)
    
  75. end)
    
  76. if success then
  77.    filterResults[fromUserId] = result
    
  78.    broadcastPetName(fromUserId)
    
  79. else
  80.    print("Could not filter pet name")
    
  81. end
  82. end)
  83. RequestAllPetNames.OnServerInvoke = (function(player)
  84. local toUserId = player.UserId
  85. local petNames = {}
  86. – go through filter results and filter the pet name to be sent
  87. for fromUserId, filterResult in pairs(filterResults) do
  88.    local filteredString = filterResult:GetNonChatStringForUserAsync(toUserId)
    
  89.    filteredString = filteredString or ""
    
  90.    -- need to convert userId to string so it can't be sent via a remote function
    
  91.    petNames[tostring(fromUserId)] = filteredString
    
  92. end
  93. return petNames
  94. end)
  95. – Listen for players being removed, and clean up old filter results
  96. Players.PlayerRemoving:Connect(function(oldPlayer)
  97. local userId = oldPlayer.UserId
  98. filterResults(userId) = nil
  99. end)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local TextService = game:GetService(“TextService”)
local Players = game:GetService(“Players”)
– Define remotes for communication with client
local Remotes = Instance.new(“Folder”, ReplicatedStorage)
Remotes.Name = “PetNamingRemotes”
local UserNamedPet = Instance.new(“RemoteEvent”, Remotes)
UserNamedPet.Name = “UserNamedPet”
–[[
RemoteEvent UserNamedPet
Paramaters: petName (string)
To be fired by the client when the user has picked a name for their pet.
Example:
local userNamedPet = ReplicatedStorage:WaitForChild("PetNamingRemotes"):WaitForChild("UserNamedPet")
userNamedPet:FireServer("Max")
]]
local SendPetName = Instance.new(“RemoteEvent”, Remotes)
SendPetName.Name = “SendPetName”
–[[
RemoteEvent SendPetName
Paramaters: userId (int), petName (string)
Fired by the server when a user changes their pet's name
Example:
local sendPetName = ReplicatedStorage:WaitForChild("PetNamingRemotes"):WaitForChild("SendPetName")
sendPetName.OnClientEvent:Connect(function(userId, petName)
	local player = Players:GetPlayerByUserId(userId)
	if player then
		print(player.Name.." has named their pet ".. petName)
	end	
end)
]]
local RequestAllPetNames = Instance.new(“RemoteFunction”, Remotes)
RequestAllPetNames.Name = “RequestAllPetNames”
–[[
RemoteEvent SendPetName
Paramaters: n/a
Fetches the names of every player's pet. To be invoked by the client when a user joins the game. 
Example:
local requestAllPetNames = ReplicatedStorage:WaitForChild("PetNamingRemotes"):WaitForChild("RequestAllPetNames")
local petNames = requestAllPetNames:InvokeServer()
for userId, petName in pairs(petNames or {}) do
	local player = Players:GetPlayerByUserId(userId)
	if player then
		print(player.Name.." has a pet named ".. petName)
	end	
end
]]
local filterResults = {}
local function broadcastPetName(userId)
local filterResult = filterResults[userId]
if filterResult then
	for _, player in pairs(Players:GetPlayers()) do 
		if player then
			-- spawn a new thread so as to not yield the update
			spawn(function()
				-- grab the filtered string for this user
				local toUserId = player.UserId
				local filteredString = filterResult:GetNonChatStringForUserAsync(toUserId)
				filteredString = filteredString or ""
				-- send the remote event
				SendPetName:FireClient(player, userId, filteredString)
			end)
		end
	end
end
end
UserNamedPet.OnServerEvent:Connect(function(player, petName)
local fromUserId = player.UserId
-- pcall to catch errors
local success, result = pcall(function()
	return TextService:FilterStringAsync(
		petName, 
		fromUserId
	)
end)
if success then
   filterResults[fromUserId] = result
   broadcastPetName(fromUserId)
else
   print("Could not filter pet name")
end
end)
RequestAllPetNames.OnServerInvoke = (function(player)
local toUserId = player.UserId
local petNames = {}
– go through filter results and filter the pet name to be sent
for fromUserId, filterResult in pairs(filterResults) do
   local filteredString = filterResult:GetNonChatStringForUserAsync(toUserId)
   filteredString = filteredString or ""
   -- need to convert userId to string so it can't be sent via a remote function
   petNames[tostring(fromUserId)] = filteredString
end
return petNames
end)
– Listen for players being removed, and clean up old filter results
Players.PlayerRemoving:Connect(function(oldPlayer)
local userId = oldPlayer.UserId
filterResults(userId) = nil
end)
2 Likes

This topic has been solved

Only reply here if:

  • You have additional details
  • The solution doesn’t work for you

If you have an unrelated issue, please start a new topic instead.

Now it’s worked thank you so much it’s working script

No I’m not missing of the code

Look at his other replies on his activity page, i think this might be a troll :cry:

1 Like

there is a chance, but we can’t discuss this here

No guys it’s not a troll I think Roblox that maybe I will fix that is the problem it’s been out coming soon I will tell you guys if that is a problem


This is my game and I’m not trolling guys

ngl use common sence
YOU LITERALLY DIDN’T PUBLISH THE PAGE

5 Likes

I was forgot to publish that I cannot save it guys but this Roblox studio to do I would think that

publish it yourself FTLOG
alt + P
@moderators hide some of these replies

2 Likes

Thank you so much now I know that

I don’t think so, He might just be from some other country


image