Remote Event Problems

So, I’ll be direct : I have no idea what that means, despite my researches.
image

Basically, I get this error in my output about one of my remote events, I don’t understand what it means, or if it has something to do with my script.

It only happens while in a server (Like TeamTest or joining from roblox’s app/website), but not in studio itself (except TeamTest).

Here’s the script, just in case it’s needed.

Please redirect me if there is a solution somewhere else. Thank you.

  • Triggers the Remote Event. (‘‘Client’’ Context script in a model’s part from ReplicatedStorage)
local t = true

local function destroy(hit)
	if t == true then
		if hit.Parent:FindFirstChild('Humanoid') then
			t = false
			local character = hit.Parent.Name
			local player = game.Players:FindFirstChild(character)
			
			game.ReplicatedStorage.SendCredits:FireServer(player)
			task.wait(0.02)
			script.Parent.Parent:Destroy()
		end
	end
end

script.Parent.Touched:Connect(destroy)
  • Recieves the Remote Event. (‘‘Legacy’’ Context script in ServerScriptService)
local rep = game:GetService('ReplicatedStorage')

rep.SendCredits.OnServerEvent:Connect(function(player)
	local reward = math.random(50,250)
	
	player.stats.Credits.Value += reward
	
	print(player.Name..' got '..reward..'$')
end)

(I have to add that the error is present without even running the scripts, and that the model spawns in workspace via another local script. It makes the error while joining the game/TeamTest)

Client scripts only run if they are inside a model somewhere in Workspace. See this article for more information. However, since Touched will fire on the server, and Legacy context server scripts will run if they are inside Workspace, you could just combine your two scripts into one where the code that ran when the SendCredits RemoteEvent fired gets run upon the Touched event getting fired. If you want to keep the same structure, try using bindable-events or having a client-sided script somewhere in PlayerScripts, or one of the other allowed locations for them to run.

local scripts can only work in a player’s character, player scripts and replicated first.
scripts with runcontext set to client can run anywhere

It errors on SendLikelySpeakingUsers, not SendCredits!!!

This is a Roblox bug, not something on your end. You don’t need to (and can’t) do anything to fix it.
It also does not impact your scripts, so you can just ignore it.

Hi, there are a few issues in your code that are causing these issues in your server script, so from what I understand, you are trying to earn “coins” (for example) and when you tap on them you get some random amount of money, right? If that is what I said, I would try to help you.

In any case i did an example for this situation if this is what you meant, this would help you to fix issues:

SERVER SIDE SCRIPT (example!)

local part = workspace.Part
local signal = game:GetService("ReplicatedStorage").SIGNAL

local state = false

local function generateMoney(hit: Instance)
	if state then return end
	
	local character = hit.Parent
	local player = game:GetService("Players"):GetPlayerFromCharacter(character)

	if player then
		state = true
		
		part:Destroy()
		
		local randomAmount = math.random(50, 250)
		signal:FireClient(player, randomAmount)
	end
end

part.Touched:Connect(generateMoney)

CLIENT SIDE SCRIPT (example!)

local signal = game:GetService("ReplicatedStorage").SIGNAL

signal.OnClientEvent:Connect(function(amount)
	print("You get: $" .. amount)
	-- or just what you wrote earlier >>> player.stats.Credits.Value += amount
end)

This should resolve these issues with your scripts, so if you encounter other problems, feel free to ask for help.

The thing is that it works perfectly fine in studio, which shouldn’t be normal is what you’re explaining…

Is there any other examples of this bug? It does impact my script, sadly.

Have you read what i wrote? Like, is that you was talking about or not?

I have, but I’m trying to understand the issues, rather than avoid it completely so I don’t repeat the same mistakes, I hope that makes sense.

playergui?

that too

didn’t get what u mean and what are you talking about, due it i do not understand completely what you trying figure out or do, like what is the issue in your script? which part doestn work correctly?

The error is related to your other remote event. “SendLikelySpeakingUsers”, not “SendCredits”. And it’s basically telling you:

“You fired the remote event to the client. However, you didn’t set up an onclientevent in a local script.”

So to fix this, just set up an onclientevent for sendlikelyspeakingusers. Your remote event isn’t even doing anything otherwise…

I’m surprised lots of people here didn’t realise that?

The thing is that I never made nor have a ‘‘sendlikelyspeakingusers’’ remote event, which is really confusing.

I don’t want to replace my whole script.

if u reread the error you’ll see that it says

RobloxReplicatedStorage.SendLikelySpeakingUsers

keyword “RobloxReplicatedStorage”, not “ReplicatedStorage” so its got nothing to do with ur code

Well looking again it says “RobloxReplicatedStorage” not “ReplicatedStorage” where it errors, unless you renamed the replicatedstorage service which I highly doubt. So actually now i’m thinking it could just be a backend problem on roblox’s end.

What you can try and do is, when you start running a session in studio. View every roblox script and try and find the keyword “SendLikelySpeakingUsers” to see where the error is coming from.

But I think you should be fine overall. My guess is roblox is adding a new update in relation to age check chatting and they haven’t completed it yet. That’s why they haven’t hooked up an event yet to that remote event they fired.

This is an “internal” error and has absolutely nothing to do with your script.