Jump to content

Recommended Posts

From rummaging around in the relevant game files, I don't know how to do this or if it's possible (seems it may be hardcoded territory?). Can I check whether a player has a specific crafting recipe unlocked (by means of having prototyped it already, or having read a blueprint of it already)?

local recipe = GLOBAL.AllRecipes["backpack"]
local player = GLOBAL.AllPlayers[1]

-- example parameters...

if player:RecipeIsUnlocked(recipe) then -- hypothetical function
   -- do stuff
end

 

Looks like my search was pretty crappy after all, I totally missed a bunch of files and keywords. Excellent, @alainmcd, thank you! :)

EDIT: For anyone interested, to do it client-side you use player.replica.builder:KnowsRecipe(recipename) . The same also works on the server side as well, so maybe no need to ever use the non-replica function.

Edited by blubuild

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...