How to HWID Lock a Roblox Script
How to HWID lock a Roblox script so a key only works on one device: how the lock works, how to handle resets, and the mistakes that annoy paying users.
You sell a key, and a week later it's running on twenty computers. That's the problem an HWID lock solves. HWID-locking a Roblox script ties each key to the first device that uses it, so a shared key stops working everywhere else.
Here's how an HWID lock works, how to set one up, and how to keep it from frustrating the people who actually paid.
What an HWID lock is
HWID stands for hardware ID: an identifier your executor reports for the device the script runs on. An HWID lock works like this:
- A player redeems a key for the first time.
- Your server records the HWID that redeemed it.
- Every later run, the server compares the current HWID with the saved one.
- If they don't match, the key is refused.
The player who bought the key never notices. Anyone they shared it with gets told the key belongs to another device. If you want the deeper explanation of hardware IDs, read our HWID ban explainer.
Why the check must be on the server
You can't HWID-lock a script with a check inside the script alone. If the script compares the HWID to a value stored in its own code, anyone can edit the value. The saved HWID has to live on your server, and the server decides whether the key runs. The script only reports.
Handling HWID resets
This is where most key systems lose goodwill. Real players change devices: a new PC, a reinstalled Windows, a different executor. If their key is locked forever, they message you, and you spend your evenings doing manual resets.
Good reset rules:
- Let players reset themselves. A button or a Discord command that clears the saved HWID. The next run saves the new one.
- Add a cooldown. One reset every day or so is enough for real players and too slow for someone trying to pass one key around a group.
- Log every reset. If one key resets every day, it's being shared, and you can act.
Mistakes to avoid
- Locking free keys you hand out daily. For temporary keys from a key flow, a lock is still useful because it stops one player from posting the key, but keep resets easy.
- No way to unlock. A key with no reset path turns your best customers into support tickets.
- Treating an HWID mismatch as a ban. A mismatch usually means a new device, not a cheater. Refuse the run; don't ban the person.
How to do it in LuaProtect
In LuaProtect, keys can be locked to the device that first uses them. Players reset their own HWID through the Discord bot, and you can see every device a key has been used on in the player's profile. That's also how you spot sharing: one key, many devices. Our key system guide covers the rest of the setup.
Checklist
- Save the HWID on the server at first redemption.
- Compare it on every run, server-side.
- Give players a self-service reset with a cooldown.
- Watch for keys that reset too often.