Workshop basics 1

first of all im not writeing this in workshop discussion cause everyone in there already knows workshop and for anyone to find this usefull they cant know a thing
second : you should go open up the workshop and mess around a bit before you read this to get a better understanding
and finally if you need help go ask in the comments

the first thing you need to understand in the workshop is variables. variables are empty at first but you can set them to values like a number or a string (a text storage) and these are the bread and butter of the workshop.
there are 2 types of variables global and player variables global variables can apply and can be edited by everyone in the lobby they are more useful for objectives player variables can only be used and messed with by the player they are attached to these are more useful for money and score you can change the variables with 2 actions the first sets it to a value (set global/player variable)and the other modifys the current value (modify global/player variable)

now here is a code for a money system 47CRZ it should display your money and give you more ever second
but if you play the game and look in the top left part of your screen you will see that the money is 1 and if you wait its still 1 go look in the code and see what i did wrong

go see what i did wrong

why are you reading this still go see whats wrong

you wont learn the workshop if you dont at least try

anyway

the problem is that i used set player variable instead of modify so change it to modify player variable event player add number 1 then if you restart you will see that our money adds up

now the other thing that you need to know is that we currently have only been using actions (everything on the right side of the rule is action) but if we add something on the left side its a condition, conditions tell your code when to do something
now i dont think giveing players money when they are picking heroes is fair as they could go afk in our lobby and make tons of money by doing nothing so add a condition that says has spawned event player = true then run the code again and as you will see we only get money when we have spawned

now for our final part of workshop load up this code YPTZE
what this does is makes a area where you can trade in money for health
you should look at this code and hopefully if you finished this should know some workshop
(this is not all of the workshop basics it is only a bit but its enough to get you started)

4 Likes