I see, that isn’t really possible because they could always remove your script protection. Unfortunately, obfuscating your code wouldn’t work either because Roblox could delete your account, people might think your script is sketchy and it can still be deobfuscated. @m4ank’s answer wouldn’t work for what you want either.
A database is difficult, but not impossible. You couldn’t use DataStoreService or HttpService because DataStoreService isn’t shared across experiences and HttpService is disabled by default. Instead you could use a Roblox asset’s description for storing data. It would be read only from scripts, but that’s perfect for your use case.
What you’d need to do is designate a single asset which should not get content deleted for any reason. Then in the description, place all the allowed creator IDs (users and groups) in the
description of the asset. Like this:
287113233,2702968750,9697297
(those IDs are my user ID, your user ID and my group ID.) Don’t put a space between IDs, just a comma. In the example I’ve used this asset https://create.roblox.com/marketplace/asset/11389869265
Inside your script you can paste this code
local MarketplaceService = game:GetService("MarketplaceService")
local product = MarketplaceService:GetProductInfo(11389869265, Enum.InfoType.Asset)
local string_ids = string.split(product.Description, ",")
if not table.find(string_ids, tostring(game.CreatorId)) then
print("fraud!")
end
Replace 11389869265 with your own asset ID. (though you can use it for testing the script initially)
Every time it is run, it’ll check if the game.CreatorId is in the description of your asset. If not it will print “fraud!”. This takes about 2 seconds.
A smaller, more obscurer version of that code is:
if not table.find(string.split(game.MarketplaceService:GetProductInfo(11389869265, 0).Description, ","), tostring(game.CreatorId)) then print("fraud!") end
Some things I suggest: instead of destroying the script, or printing anything, you should make the script silently not work, therefore people are more likely to dump your script than remove any anti theft components.
When you want to allow new people to use your script, just go to the Creator Dashboard and edit your asset’s description.