#CW-crafting

1 messages · Page 1 of 1 (latest)

fallow cliff
#

I got almost everything working, the only part i dont get is how the blueprints lock or unlock the ability to craft or not. Learning the blueprints work. Got them in the loot tables. It just doesnt seems that it matters if i learned them or not.

  • In the vid, it shows that if you learn a bp that is only available for certain jobs (or table?), it unlocks for the player. I dont get this to work. Its all depending on recipes
    Any idea where i go wrong here?

I have the feeling i mix up the tables and job requirement but i cant figure it out

thanks for the help

zealous apex
#

So it's not unlocking the recipe?
Could you post the recipe you're trying to use here?

#

item is the recipe item (whats in your config), recipe is the name of the recipe

#

also turning debug on and checking print outs can help you diagnose this ^

fallow cliff
#

thanks for the fast awnser!

Ill try to explain it a bit beter, I have the feeling i just overlook something lol

  • lets say i have learned a blueprint 'electronickit' -->

  • if there isnt a recipe, what would this allow me to do?

  • If there is a recipe, but its locked behind a job that i dont have, what would it do?

  • if there is a recipe, and not locked behind a table or job, do i even need the BP?

['electronickit'] = {
category = "Tools",
toItems = {
electronickit = 2,
},
materials = { metalscrap = 12, plastic = 12 },
craftingTime= 3000,
craftingSkill= 10,
blueprint = 'electronickit', -- blueprint name. Case sensitive to the blueprint name! (optional)
maxCraft = 20, -- the max amount you can craft in one batch (optional)
jobs = { -- table of job requirements (optional)
{ type = 'mechanic', level = 2 }, -- example of a job using TYPE rather than name
},
tables = {'mechanic', 'police'}, -- specific tables this recipe can be made at
},

#

If there is a recipe that would need a bp, i can still craft it if i didnt learn it i think

zealous apex
#
  • If no recipe uses the blueprint "electronickit" it won't do anything if you learn it.
  • If it's has requireBlueprintAndJob = true then it will require BOTH job and blueprint (i just noticed this is missing in the readme 🚨 ), ei you wont see it.
  • It depends on how the recipe is set up. They can be set up to require both, require one or require none.
#

Your electronic kit would be locked behind both blueprint and job, and only accesible on the mechaninc and police tables

fallow cliff
#

let me see and test some stuff with this new info, I really appreciate the help 10 / 10 ngl

zealous apex
#

Ah wait I'm dumb. Your recipe would require EITHER job or Blueprint

#

If you want both you can add requireBlueprintAndJob = true

fallow cliff
#

So when i dont have the job ( garbage) but i learned the bp, i dont see it still i think. Ill test that now

#

with my stuff set up like this, im gonna test some stuff.

atm, the blueprint part doest work for me. It looks like it doesnt care if i learned it or not. if its a recipe, and i have the right job, its availble for me

#

wait xD

#
  • requireBlueprintAndJob = true works --> I had the job, not the bp learned and i couldnt see it, When i learned it, it worked ( electronickit)
zealous apex
#

But it still doesnt work if you have the bp but not the job?

#

Obviously that wont work when requireBlueprintAndJob = true

#

but before that I mean

fallow cliff
#

yeah

#

thats exactly my problem atm

zealous apex
#

Enable debug then remove requireBlueprintAndJob then, and open a table with the recipe that should be there

#

check prints

#

it will tell you what is failing

fallow cliff
#

tyty

#

so the table still need to have the bp?

#

like, if i am garbage man, the mechanic table just goes to a normal crafting table right?

zealous apex
#

No, if you're a garbage man and you're trying to use a table that has it's job set to mechanic then you wont see the interaction

fallow cliff
#

for me it changes to a normal crafting table

#

it does work if i use the guns table btw

#

if i use the mechanic one, it doesnt

zealous apex
#

Did you set the basic one to also use the same prop?

fallow cliff
#

yeah that is the problem i think !!!!!!!

#

omg

#

im such a nerd

zealous apex
fallow cliff
#

xD

#

let me test

#

think its all working now

#

thank you bro!

#

if its not to much to ask, can you explain how i can bring the bps to the city? Im kinda new in with this, and only got it working with a treasure script.

I read a comment of yours from a long time ago where you said its a good idea to use:

local chance = math.random(100)
if chance < 10 then
-- exports['cw-crafting']:giveBlueprintItem(source, 'repairkit')
-- exports['cw-crafting']:giveRandomBlueprint(source, {min = 1, max = 2}, 990)
end

can you maybe give me some examples how can implement this in scripts? i am most of the time lost where to actually add something if a lot is already written

fallow cliff
#

an other thing that isnt working for me atm is the the special part from your carboosting script,

Config.SwapItem = "swap_slip"

Config.Special = {
["sultan"] = {
{type = "special", value = "sultanrs", title = "Sultan RS", swapslip = "sultanrs"},
{type = "special", value = "sultanrsv8", title = "Sultan RS V8", swapslip = "sultanrsv8"},
},
["banshee"] = {
{type = "special", value = "banshee2", title = "Widebody Banshee ", swapslip = "banshee"},

if i test it with a sultan at

name = "tuner",
title = "RS Swaps & Rebuilds",
coords = vector4(964.49, -1528.53, 30.5, 96.39),
garage = "tuner",
types = {
["lowrider"] = Config.Types.lowrider,
["donk"] = Config.Types.donk,
["drag"] = Config.Types.drag,
["resto"] = Config.Types.resto,
["drift"] = Config.Types.drift,
["raised"] = Config.Types.raised,
["widebody"] = Config.Types.widebody,
["special"] = Config.Types.special
},

it tells me this shop doesnt do these type of cars

#

sorry for al the questions, I installed all your scritps yesterday and have like 3 small issues in total lol

fallow cliff
#

only other issue i have is with cw-darkweb --> doesnt find transaction with re phone --> util sunset isnt a resourse. anyway i can rewrite it?

zealous apex
#

The special ones only show up if you got the token/swap slip

fallow cliff
#

oeff i might have done the wrong boost lol

fallow cliff
zealous apex
fallow cliff
#

i just wont use it then atm, thought for future updates

#

ill test the boosting one in a bit and let you know, but i prob did the wrong boost

zealous apex
fallow cliff
#

if its not to much to ask, can you explain how i can bring the bps to the city? Im kinda new in with this, and only got it working with a treasure script.

I read a comment of yours from a long time ago where you said its a good idea to use:

local chance = math.random(100)
if chance < 10 then
-- exports['cw-crafting']:giveBlueprintItem(source, 'repairkit')
-- exports['cw-crafting']:giveRandomBlueprint(source, {min = 1, max = 2}, 990)
end

can you maybe give me some examples how can implement this in scripts? i am most of the time lost where to actually add something if a lot is already written

#

tell me when to stfu xD

zealous apex
#

Just add that to a server file of any script where theres loot/payouts

fallow cliff
#

ill try to play around with it in abit
thanks for the help

fallow cliff
#

it keeps telling me that this spot doesnt support this type of car

zealous apex
#

Try enabling debug

fallow cliff
#

where do i do that for that script?

zealous apex
#

config

#

like all scripts from cw

fallow cliff
#

mi blind i think

zealous apex
#

oh

#

you're right

#

script doesnt have debug

#

rip

#

In that case I don't know

#

works for me

fallow cliff
#

i might redo it lol

#

ill try again

#

I think its because the swapslips are not bound to a specific car, it just give me a swap slip, in the config, it show the actual car name. that maybe it?

zealous apex
#

If you do the boostjob missions they should give you swapslips with the correct value

#

You're using the correct inventory I assume?

fallow cliff
#

it gives ma a swap slip. they are unidentified tho i see now

fallow cliff
zealous apex
#

In qb it wont say what value it is unless you add it

#

afaik

fallow cliff
#

ahh fair

zealous apex
#

I dont use QB

#

so cant really help you there

fallow cliff
#

ahh unlucky

#

its in app.js i guess?

zealous apex
#

Absolutely no idea how to add it

#

haha

fallow cliff
#

heheh fairr

fallow cliff
#

I got it to shop up,, but that wasnt the fix

#

} else if (itemData.name == "lawyerpass") {
var finalLawyerPass = firstNamePart + lastNamePart + "<br><br>" + csnPart + "<br><br>" + "</p>";
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(finalLawyerPass);
} else if (itemData.name == "swap_slip") {
var finalswap_slip = firstNamePart + lastNamePart + "<br><br>" + csnPart + "<br><br>" + "</p>";
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(swap_slip);
add

} else if (itemData.name == "swap_slip") {
var finalswap_slip = firstNamePart + lastNamePart + "<br><br>" + csnPart + "<br><br>" + "</p>";
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(swap_slip);

under

} else if (itemData.name == "lawyerpass") {
var finalLawyerPass = firstNamePart + lastNamePart + "<br><br>" + csnPart + "<br><br>" + "</p>";
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(finalLawyerPass);

in html - js - app.js

zealous apex
#

Hot tip. To make your code readable in discord, wrap it in
```lua

```

fallow cliff
#

tyty, how do i even do that xD

zealous apex
#

but I dunno man. Maybe QB fucked something up and shit aint working no mroe

#

the script is very dated

#

and I don't run QB inv anymore so no way for me to test

fallow cliff
#

fair, i can try to move the cars to other cats?

zealous apex
#

do the other category work?

fallow cliff
#

yeah they do

#

so its something with this swap thing

#

i might just get rid of it, and put a price on it?

zealous apex
#

yeah might be that they removed something with inv shrug wouldnt surprise me if the made qb inventroy even more shit than it used to be

fallow cliff
#

hehe

fallow cliff
#

isnt the boosting script pointless of the swapslips dont work?

zealous apex
#

Yeah if you can't get it to work it's kinda useless

fallow cliff
#

for the cars to go to other categories without rewriting all i did this

#

i dont know how to wrap xD

zealous apex
#

It might be an issue related to fetching data actually

#

But the annoying part is that due to QB being shit it's gonna be a hassle to fix lol

fallow cliff
#

and one more question about cw-token and cw-crafting

can you please explain to me how i can get players tokens and blueprints. I saw you were talkin about

in CW-tokens
TriggerEvent('cw-tokens:server:GiveBuyToken', src, 'tradeSandwich')

in cw-crafting
local chance = math.random(100)
if chance < 10 then
-- exports['cw-crafting']:giveBlueprintItem(source, 'repairkit')
-- exports['cw-crafting']:giveRandomBlueprint(source, {min = 1, max = 2}, 990)
end

fallow cliff
#

thanks tho!

zealous apex
#

Pushed a fix

fallow cliff
#

wait what xD

#

how do i update it then?

zealous apex
#

download it again

fallow cliff
#

damn xD

#

so the fix makes the slips work again?

#

do i need to do a new boost to test it?

fallow cliff
#

if you dont mind

zealous apex
zealous apex
fallow cliff
#

didnt work, need to slip right?

zealous apex
#

you need a slip yeah

#

try command /createswapslip sultanrs

fallow cliff
#

tyt

zealous apex
fallow cliff
#

nah, i understand that, im just very new, and didnt have to do it ever. started like 3 weeks ago

#

i got it working in one script, just was looking for a guideline or whatever

#

RegisterNetEvent("glow_treasure_sv:completeDig", function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerCoords = GetEntityCoords(GetPlayerPed(src))
local chance = math.random(100)
if chance < 50 then
exports['cw-crafting']:giveBlueprintItem(source, 'repairkit')
-- exports['cw-crafting']:giveRandomBlueprint(source, {min = 1, max = 2}, 990)
end

this worked so i am happy already, just need to figure out how to do it everywhere lool xD

fallow cliff
#

if i do the boost for the banshee, it gives me a slip, if i use that one to change a banshee to a banshee2, it dstill gives the same prompt

#

and doesnt work

zealous apex
#

The banshee exists in both special and normal

fallow cliff
#

yeah, but if i do the boost, that paper wont work, if i create one with the command, it does work

#

so it might go wrong somewhere where the item you get from boosting isnt the same as the one you create with the command?

zealous apex
#

dunno how it works wit hthe command

#

the default special option for banshee is incorrect in the configthumbup

#

The swapslip value is missing a 2

fallow cliff
#

ahh let me test

#

but when i did /createswapslip banshee, the slip let me change the banshee to a banshee wide

zealous apex
#

if you remove the 2 from "banshee2" it becomes "banshee"

#

so that makes sense

#

since you input the wrong value in the command LuL

#

the value its supposed to take is the car you're swapping TO not from

fallow cliff
#

but how does it work then? is my point

#

yeah i get that

zealous apex
#

you input the incorrect value "banshee"

#

In the config, the swapSlip should've been "banshee2" but it was "banshee"

fallow cliff
#

ahh

#

i get you

#

so it reads banshee right now

#

and not banshee2

#

my b

zealous apex
#

two error makes one correct LuL

fallow cliff
#

i get it xD

zealous apex
#

i pushed a fix for the config

fallow cliff
#

you are a beast ngl

#

tested and working

#

I got the blueprint now as a reward in 2 scripts, testing the 3rd one.

the tokens i have a little less succes. gonna try that later on again

#

thanks for all the support btw!

zealous apex
#

And, if it's not clear. There's a randomizer around it

#

So it only does give the token if the roll beats the check

fallow cliff
#

i will check the token ones now

#

RegisterNetEvent("glow_treasure_sv:completeDig", function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerCoords = GetEntityCoords(GetPlayerPed(src))
local chance = math.random(100)
if chance < 50 then
exports['cw-crafting']:giveBlueprintItem(source, 'repairkit')
-- exports['cw-crafting']:giveRandomBlueprint(source, {min = 1, max = 2}, 990)
end

this is currently working for me with the blueprints,

can i do the same with

TriggerEvent('cw-tokens:server:GiveBuyToken', src, 'tradeSandwich')

oe how do i write someting like this?

zealous apex
#

I would use
TriggerEvent('cw-tokens:server:GiveToken', src, 'banshee2')

fallow cliff
#

where do i add that?

zealous apex
#

Same as the exports for cw-crafting

fallow cliff
#

sorry dfor the noob questions

zealous apex
#

also "src" needs to be defined. Like the code you posted above, or just use "source"

fallow cliff
#

if chance < 50 then
TriggerEvent('cw-tokens:server:GiveToken', src, 'banshee2')
end

#

like this?

zealous apex
#

yep

#

as long as src is defined as the example you gave

fallow cliff
#

what is the source in this example ?

zealous apex
#

source is the id of a player

fallow cliff
#

local src = source this you mean?

#

im such a noob xD

zealous apex
#

yes

fallow cliff
#

am i understanding you correct? xD

zealous apex
#

Yup

fallow cliff
#

W

zealous apex
#

that will, with a 50% chance give you a token for a banshee2

fallow cliff
#

can i also combine them?

zealous apex
#

yeah

fallow cliff
#

can i add both?

zealous apex
#

yes

fallow cliff
#

does it have to be seperata or in the same line?

zealous apex
#

You know... you can always try stuff also LuL trial and error is a way better way to learn

#

separate lines

fallow cliff
#

trust me, i have

#

I dont always have te opportunity to talk so someone about this who actually awsners ngl

#

so ill take it with both hands lool

zealous apex
#

You got lucky. I was bored today LuL

fallow cliff
#

hehe i understand this doesnt always is the case lol

#

is this correct?

zealous apex
#

yes, but it will only roll the chance once and give both now

fallow cliff
#

oef

#

can i call it chance2?

#

or some shit

zealous apex
#

yep

fallow cliff
#

damnnn

#

will this give 1 item with 1% and 1 with 99%?

zealous apex
#

Tis will give you a 1% chance to get the blueprint and a 0 % chance to get the token

fallow cliff
#

oh xD

zealous apex
#

since you did not define any chance2

fallow cliff
#

how would i do that if you dont mind me askin

zealous apex
#

Try reading the code you got there. And figuring it out

fallow cliff
#

nvm i see it i think

#

let me see

zealous apex
fallow cliff
#

jheeez

#

i m not gonna lie, i just stared doing shit xD

#

and this helped a lot

zealous apex
#

Oh and i THINK math.random will return 1 as the lowest

#

so if you want it to be 1% it's gotta be if chance < 2

fallow cliff
#

tyty

zealous apex
#

Youre on your own now. I'm heading to bed. Wouldnt expect me to be this helpful most days LuL

fallow cliff
#

thanks for the help! I understand you most likely busy normallly. i will still shoot some questions here and there tho ngl!

#

have a good one!

#

shit, it wont give me the token, i might have somethning wrong still xD

fallow cliff
#

sorry if i come with an other question, and no rush tbh. but i cant figure out how to get token in the server

the blueprints work, i just cant get the server to give out the tokens

zealous apex
#

Any prints in F8 or in server side console?

fallow cliff
#

nah nothing

fallow cliff
#

Anything wrong with the event? Does it need to be GiveBuyToken?

Or is it located wrong?

zealous apex
#

Did you try GiveBuyToken?

fallow cliff
#

I tried both

#

Because that's the export that's is given un the gift hub

zealous apex
#

Script is old as sin. Might not work anymore with newer qb or someting shrug

fallow cliff
#

Ahh fuck

#

But I do it correct, so it's not me doing stupid stuff?

zealous apex
#

looks good to me

fallow cliff
#

Fuck xD hehe

#

Ill distribute just empty token into the server then. I can just set that as ab reward right for certain activities (im a noob)

zealous apex
#

I guess you might be able to add the tokens via just normal addItem also.

Player.Functions.AddItem('cw_token', 1, nil, { value = WHATEVER_VALUE_YOU_WANT_TO_USE_HERE})
fallow cliff
#

oehh, ill try that one, also at the reward section in the code?

zealous apex
#

yeah

#

obviously you need to define Player also

fallow cliff
#

tyty

fallow cliff
zealous apex
#

Not sure if it's showing value or label. Does it work to use it?

fallow cliff
#

fair, did think about that, let me test

#

nah it doesnt work

zealous apex
#

Alright, then i dunno. good luck in your endeavours

fallow cliff
#

thanks for the help! was worth a try

#

Ill use it to give out empty ones! if you ever find out how to get the value in there, let me know pls