How to detect when a player has denied script injection permission on a plugin?

Hello!

So recently I was making a plugin, and when I published it I was greeted with this “script injection permission”, I understand what its purpose is, and that’s not the answer I am looking for, I want to know, Is there a way to detect when a player has denied plugin script injections, because when my plugin has script injections disabled, it completely breaks… And I would like to prompt a message to the player to inform them that the plugin won’t work…

So… Is there an way for me to detect the player declining the script injection permission request?

And also, what exactly triggers the script injection permission request? In my plugin I am not creating new scripts, nor am I Injecting any scripts into the game.

In my plugin I use: Module Scripts (require()) and MarketplaceService HTTP requests (to get details on certain asset ids). Could that be triggering the script injection permission request?

Hello,

I know this post is from a year ago lol but I had this same exact problem that’s how I stumbled upon your post I’ve found that this will work for me.

	local ScritpInjection = false
	
	local success, errorMessage = pcall(function()
		ScriptInjectionEnabled = Instance.new("Script")
		ScriptInjectionEnabled.Name = "Delete This"
		ScriptInjectionEnabled.Parent = game.ServerScriptService
	end)
	
	if not success then
		warn("Script injection is not enabled, Please enable it for the plugin to work")
	end
	
	ScriptInjectionEnabled:Destroy()
	ScritpInjection = success
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.