Hello! I am having problems with RemoteEvents/RemoteFunctions. When I fire an event from the client/server, the other side doesn’t respond at all and there aren’t any errors in the output. Here is my code:
game.ReplicatedStorage.NamePet.OnServerEvent:Connect(function(player, name)
print(name)
local pet = CS:GetTagged(player.Name .. " Pet")[1]
local filteredText
local success, errorMessage = pcall(function()
filteredText = textservice:FilterStringAsync(name, player.UserId):GetChatForUserAsync(player.UserId)
end)
if not success then
warn("Error filtering text:", name, ":", errorMessage)
filteredText = "[An error occured while filtering this text]"
end
pet.Name = filteredText
end)
I have no idea what is happening and I’ve tried troubleshooting in different places with print(), and the only result I have gotten is that the opposite of the side I’m firing the event on doesn’t do anything when the event is fired.
Have you checked if there even is a NamePet on the server side? Are you using the correct “RemoteEvent”? Give a picture of the output, and the explorer. Also I suggest that you put the remote event inside the localscript, then put the serverscript inside the remote event.
Sorry my computer is really weird with screenshots so I cant send one of those but the serverscript is n serverscriptservice, the NamePet remoteevent is in replicatedstorage, and the localscript is in startergui
Bro, putting a serverscript into a localscript doesn’t make it stop working. It is still going to work exactly the same, just that it has a different parent.
I just tried it and it works thanks! I just realized how dumb I sounded I completely forgot that players are still on serverside for some reason lol. Im still kinda confused on why it wouldn’t work in serverscriptservice tho