Remote event fires randomly?

There is a glitch in my obby where when the player opens the Roblox menu or even when the player clicks sometimes, a remote event for some reason fires, and that remote event is tied to prompting a product purchase, and then you can guess what happens.

Usually, the remote event fires when the player clicks a text button on the side of their screen, but this occurs even when the mouse is elsewhere on the screen.

This has become quite annoying, and I’m wondering how to fix it. Any help is appreciated.

Did you use any free model for the text button that should prompt the Product Purchase?

I wouldn’t recommend doing so, many people put malicious code into their models. Before getting any free models into your game, you should make sure its trusted or first test it properly in another game and if any viruses are there, you can possibly remove them.

You can share any scripts you find inside the model, we can help you find the malicious code, if there.

I did not, I do not use free models.

Actually, could you also share the script that fires the remote event?

function PromptPurchase()
	game.ReplicatedStorage.RemoteEventsandFunctions.RemoteEvents.PromptPurchasetoPlayer:FireServer()
end

script.Parent.MouseButton1Click:Connect(PromptPurchase) -- pc users
script.Parent.TouchTap:Connect(PromptPurchase) -- mobile users
game.ContextActionService:BindAction("promptPurchase", PromptPurchase, false, Enum.KeyCode.ButtonY) -- for console users, and yes, ContextActionService is indeed a child of game
1 Like

There isn’t anything wrong with the script, are you sure this isn’t a free model? Because unless there is malicious code injected into your game there isn’t a way Remote Events Fire Randomly as I know.

Yes, this isn’t a free model, I remember quite clearly me making it myself today.

Are the remote events that are fired randomly and the one that is fired when clicked on the button same?

I think so, because how else would it be prompting the purchase just randomly?

I meant to say is the purchase prompting to the same product?

Yes, I only have one product as well.

If there isn’t any malicious scripts in the game its not possible to fire remote events randomly, until and unless you didn’t make a script to fire them randomly. So I would recommend you to check if theres anything malicious or try to get more info why this is happening. :slight_smile:

Here is a video of what is happening.
robloxapp-20200804-2244056.wmv (3.0 MB)
This is also the only script prompting the purchase, in which it is supposed to.

That doesn’t seem like malicious code, its most likely a problem with how you set your UI I believe, the fire event might be binded to a Button Or Frame maybe which is over lapping the screen.

what remote event fires? also i see nothing wrong with the code

This is all of my GUI.

did you keep the gui visible on xbox? because xbox can click x and the button at the same time

I’m not on Xbox, and that would make sense anyways considering the keybinds.

Well considering that this is firing “randomly”, maybe you made another remote event and you meant to fire that remote event instead of the purchase prompt.

go to test and click the device and click the menu and select xbox and test it

btw

MouseButton1Click:Connect()

can be for mobile users too!