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.
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
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.
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.
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.
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.