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
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
- 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)
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)
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
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
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
Thank you so much now I know that