CakeScript G2

[release]CakeScript G2 1.0.3

Last Update: June 14, 2008

Latest Updates:
[ul]New GUI[/ul]


• Half a brain

• Basic LUA Knowledge (Not too much needed)

• Global schema must always be loaded

• Malawar’s Tools NOT installed on server/client.
[/release][release]Upcoming Features:
• Bug fixing
Getting some

Q: My Garry’s Mod freaks out when I first spawn!
A: Still not sure why this happens, but in previous experiences apparently Malawar’s Tools was doing it. If you experience this, please post screenshots and any LUA errors you find in your console.
**Q: Where is the documentation? **
A: I’m creating a wiki.
**Q: How easy is this to use? **
A: Let’s just say for something that takes a month in TacoScript to make and massive gamemode modifications, you can make in CakeScript in under an hour without any gamemode modifications.
**Q: Does this conflict with anything? **
A: Malawars tools (clientside), ULX sometimes conflicts (apparently the CID), still figuring out other things.
Q: Animations are screwed up!
A: Extract “source 2007 shared models.gcf” and upload/copy everything to your server.
How to make a Team
Teams are relatively easy to make, but you need to first make your own schema (Unless you are running an HL2RP server).

To make a schema, you need a schema definition file (schemas/myrp.lua), a schema folder, (schemas/myrp/), and a plugins and items folder inside of the schema folder.

Here is a basic schema definition file.
SCHEMA.Name = “My Awesome RP”;
SCHEMA.Description = “Omg!! My first RP schema!”;
SCHEMA.Author = “LuaNoob”;
SCHEMA.Base = “global”;

function SCHEMA.SetUp()

-- Team Initialization Functions Go Here


For an easier way to make teams, I’d suggest you make team ‘templates’.
You can find an example set of templates in the hl2rp schema plugin, hl2rp_templates.lua

There are other methods of adding teams which I will cover soon enough, but templates is the easiest way.

Here would be an example template file
PLUGIN.Name = “Team Templates”;
PLUGIN.Author = “LuaNoob”;
PLUGIN.Description = “My first template, yay!”;

function PLUGIN.Init()
– Nothing going on in here

function CAKE.CitizenTeam(name, color, flag_key, business, public, item_groups, canvote)

local team = CAKE.TeamObject(); = name or "Citizen";
team.color = color or Color(0, 255, 0, 255);
team.flag_key = flag_key or "citizen"; = business or false;
team.public = public or true;
team.item_groups = item_groups or { };

-- This is used for the voteflags plugin. It isn't neccessary but I'm just putting it in here incase you need it
team.canvote = canvote or true;

return team;


Now, we would go back into our schema definition file and add these lines.
I’ll make a pharmacist, grocery seller, black market, and regular citizen. (Item groups 1, 2, and 3 respectively, of which I will cover later)
CAKE.AddTeam(CAKE.CitizenTeam(“Pharmacist”, Color(255, 0, 0, 255), “pharmacist”, true, true, { 1 }, false));
CAKE.AddTeam(CAKE.CitizenTeam(“Grocery Seller”, Color(0, 0, 255, 255), “grocery”, true, true, { 2 }, false));
CAKE.AddTeam(CAKE.CitizenTeam(“Gun Dealer”, Color(255, 255, 0, 255), “gundealer”, true, false, { 3 }, true));
Please note, the FIRST team that is added will be the default team.

Now we need to add selectable player models (for character creation).
Here is every single citizen model.
Please note, ALL models must be in lowercase.
You’ll need to add the models to the animations.lua file later if you want them to be animated. (Citizen models are already added, as well as NPC models)

Now, items are pretty simple and straightforward. Here is an example item.
ITEM.Name = “Watermelon”;
ITEM.Class = “watermelon”; – Classname, if this is a weapon it should be the weapon’s classname so you can use rp_dropweapon
ITEM.Description = “A ripe juicy watermelon”;
ITEM.Model = “models/props_junk/watermelon01.mdl”;
ITEM.Purchaseable = true;
ITEM.Price = 3;
ITEM.ItemGroup = 2; – Our grocery seller, remember?

function ITEM:Drop(ply)

-- What happens when the player drops the item


function ITEM:Pickup(ply)

-- What happens when the player picks up the item


function ITEM:UseItem(ply)

-- What happens when the player uses the item (TAB + RightClick)
ply:ConCommand("say /me eats a watermelon.");

Just put that in schemas/myrp/items/! The lua file MUST be the same name as the classname.

You can always find the latest team table structure in teams.lua under the TeamObject function.

Thanks to bios element for helping me here and there, as well as the community owners that run my script. :smiley:

Sweet Jesus it’s released! Now I need to figure out how to use CakeScriptG2.

At first I was like :geno:
Then I lol’d :v:

I like cake. I Download now

Cake I like download I now.

This is pretty much sexy. I look forward to seeing this on some hot servers.

At first I lol’d :v:
Then I was like :geno:

I really enjoyed beta testing this. :excited:

Woah It really is you I was all thinking you were an impostor of sorts coming to steal my soul.


If your having a bug with items touching a door and spamming

Error: Function (Touch) not found! on Scripted Entity (item_prop)
Error: Function (EndTouch) not found! on Scripted Entity (item_prop)

in console, go to CakeScriptG2\entities\entities\item_prop\cl_init.lua and add this code.

function ENT:Touch( hitEnt )

how’s about screenshots of it?

I can’t make myself admin to become civil protection

Add your STEAMID to the SuperAdmins table, or Admins… either way.

(of which is in admins.lua)


Is there an SVN for it?


No pictures or what’s new on this release?

I need to decide if I should update or not.

Oh shit,

it’s released.

But shit, I have to remake all my old plugins, SSTRP is temporarily dead.