This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- How to make a basic DarkRP job | |
-- Here is an example of a default one from my server | |
TEAM_HOBO = DarkRP.createJob("Hobo", { | |
-- TEAM_HOBO is the name for the team used in the code, it wont be seen by players in game | |
-- ("Hobo" is the name that will be seen by players in the game | |
color = Color(80, 45, 0, 255), | |
-- This is the color for the team in the F4 menu and tab menu | |
-- The first nubmer is red, then green, then blue | |
-- Always leave the last number to 255, it is transparency | |
model = "models/player/corpse1.mdl", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Here is the finished code for the whole job | |
-- Now I will explain | |
TEAM_MAYOR = DarkRP.createJob("Mayor", { | |
color = Color(150, 20, 20, 255), | |
model = "models/player/breen.mdl", | |
description = [[The Mayor of the city creates laws to govern the city. | |
If you are the mayor you may create and accept warrants. | |
Type /wanted <name> to warrant a player. | |
Type /jailpos to set the Jail Position. | |
Type /lockdown initiate a lockdown of the city. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a comment, the two dashes mean that it will not be read by the computer | |
alert("Welcome to game!") | |
// This will present a message, in which the user must hit ok to continue. | |
confirm ("I am ready to play this game") | |
// This line asks the user if they are ready, it will present a pop up message, with the only option being to continue or quit. | |
// Now for something a little more difficult. | |
var age = prompt("What's Your Age?") | |
// A variable is something that the computer will save for later. | |
// We have named the variable age | |
// We have told the computer, that the variable age, is equal to whatever the user puts into the prompt. |