• CakeScript G2
    934 replies, posted
[QUOTE=ChewGum;13971888]Why would you do local ply when you already have the player object in the function?[/QUOTE] Because i suck at lua (and someone told me to try it). Any ideas on what i need to add in order to make it work?
Hi again! I'm trying to make a function that makes it so that if a player is tied up, they lose their weapons, and if they are untied, they should get them back. If this is not possible, making them lose their weps will suffice Here is the current code: [lua]function GM:SetupMove(ply, move) if( ply:GetNWInt( "tiedup" ) == 1 ) then move:SetMaxClientSpeed( 100 ); --player moves slower when tied up, increasing the number makes it faster, decreasing makes it slower. ply:StripWeapons(); ply:Give("hands") pl:SelectWeapon("hands") return; end end[/lua] I suck at lua coding so i could really use your help here! Thanks in advance! Regards, Pete
Check the GMod Wiki [url]www.wiki.garrysmod.com[/url] I bet it has a weapon strip function
[url]http://wiki.garrysmod.com/wiki/?title=Main_Page[/url] is the right link :p
[QUOTE=Kirad;13996037][url]http://wiki.garrysmod.com/wiki/?title=Main_Page[/url] is the right link :p[/QUOTE] Thanks for the link, but i've already searched there, i tried searching for "strip" and it came up with nothing relevant. Any ideas? [b]Edit:[/b] Alright i finished the code, i tested it and it works now (i experiemented my way to success) :D Here it is for future reference! You may use this on your cakescript server if you wish! [lua]function GM:SetupMove(ply, move) if( ply:GetNWInt( "tiedup" ) == 1 ) then move:SetMaxClientSpeed( 100 ); --player moves slower when tied up, increasing the number makes it faster, decreasing makes it slower. ply:StripWeapons(); else if( ply:GetNWInt( "tiedup" ) == nil ) then GM:PlayerLoadout(); return; end end end[/lua] At the moment it strips the player of their weapons, however it does not give the weapons back when they are untied... I've already tried GM:PlayerLoadout() and that made no difference. Thanks in advance!
So, whats about G3? You're too lazy to finish it or what? Or maybe you keep thinking that CakeScript is bugged?
Is Realy dead ;( is good mod
If i had permission to edit this gamemode, re-release it, and carry it on from here then i would map for it and lua code it...
[QUOTE=Fobaz;14011932]So, whats about G3? You're too lazy to finish it or what? Or maybe you keep thinking that CakeScript is bugged?[/QUOTE] It's called I have a busy life, not that I'm lazy. My future is more important than your roleplay, sorry.
[QUOTE=Janorkie;14168917]It's called I have a busy life, not that I'm lazy. My future is more important than your roleplay, sorry.[/QUOTE] Now I go and suicide. Good bye cruel world!!
I'll look into doing some improvements to it. But don't hold your breath. If someone PM's me a list of all the bugs and whatever suggestions they have I'll see what I can do.
[code]ERROR: GAMEMODE:'Initialize' Failed: CakeScriptG2\gamemode\schemas/hl2rp.lua:33: attempt to call global 'HL2Team' (a nil value)[/code] This would pop up on EVERYTHING I do... I seriously would like to know if anyone else is having this stupid problem. I got many other schemas/templates working in the past but everything I make (I think the default HL2RP by LuaBanana is broken for me as well) shows up with this error, and the HL2Team changes as I change the function (or team name.) If anyone would like to see the schema/template; please ask me, but I stopped thinking that it was a problem along the schema files... it's always good to ask though, right?
[QUOTE=gamei56;14279467][code]ERROR: GAMEMODE:'Initialize' Failed: CakeScriptG2\gamemode\schemas/hl2rp.lua:33: attempt to call global 'HL2Team' (a nil value)[/code] This would pop up on EVERYTHING I do... I seriously would like to know if anyone else is having this stupid problem. I got many other schemas/templates working in the past but everything I make (I think the default HL2RP by LuaBanana is broken for me as well) shows up with this error, and the HL2Team changes as I change the function (or team name.) If anyone would like to see the schema/template; please ask me, but I stopped thinking that it was a problem along the schema files... it's always good to ask though, right?[/QUOTE] Strange. I've never had that bug. In fact I just tested it a minute ago. So I'm not sure what to say man.
Have you noticed that the / got switched instead of the \? I'm confused D:
i can look like a noob but how to use it?
Very good gamemode. But i have some questions: 1. How can i make so that every player can spawn props? 2. How can i make so that players spawn with Pyshics and tool gun? 3. Why cant i see my weapon?(When i buy a weapon and use it i cant see it on my screen)
1 & 2, look at concmd.lua 3. bind <key> rp_toggleholster
me like gui me leik cake me leik script me leik u me leik cakescript ja.
Don't talk all nubbish Critycal, please. I agree I <3 Cakescript!
Hah! Critycal is my friend :P, but anyway how do I make the flags/classes spawn with weapons?
Hey, bumping this thread as I am hoping for/looking forward to G3. This is made of win, and makes DarkRP look like the pile of crap that it is. I'm attempting to make some kind of Steampunk Schema for this, I requested someone make one but I decided to try it myself first. (Anyone have a good modelling tutorial? XD) Anyway, keep up the good work.
Ahahaha, you sneaky bastard. He has his steam ID placed in the Super Admin tables in places throughout the LUA. In daynight.lua for instance. None the less, you damn well deserve super admin anywhere that uses your code, especially considering it kicks so much ass! Anyways, you should continue working on this, tis great!
Any wiki for dis ?
LOL, Wiki?!
Looks nice!
Yeah what Apple said. I hope there is a G3. A nice Admin menu, that allows you to create Flags easily would be so kick ass.
Hey I added new models by editing the schema/teams. And now all the models are T shaped and have no animations. How do i fix this?
I also have a bug, it's with Multiplayer. I dunno if it's fixed or not, but it all just goes to hell as soon as I try it :S. It gets stuck on an HEV suit with no textures, nothing works, and all the names are removed. No error messages are produced either! Do I have to update, or can Nori give me some info on this issue? And I really mean it, NOTHING WORKS, all the models = gone, all the functions = gone, all the commands = gone. I'm running this on a server that has ULX, Wire, DarkRP (modified), CSS Realistic, and other addons. Does anyone know where the conflict is coming from?
Well I'm trying 1.0.4, and it seems it STARTED working on the server. That stupid DPanel error keeps popping up, and Bio, before you start trolling, I am aware that it's been reported. Just trying some things for a quick fix until the next version (KEEP GOING LUA BANANA, YOUR FANS ARE BEHIND YOU (not raping you)). So no fix for DPanel? Well fuck :S.
SHOOP TRIPLE POST, anyway I managed to find a way around DModelPanel thanks to a post a while back. Turns out all you have to do is rejoin and select model will start working again. Anyway here's another question, I can't get the default schema to switch from hl2rp to the schema I'm trying to load, it's written correctly since it's pretty much a copy of hl2rp. ALSO, I found why people couldn't use rations! There IS an extra nil in the teams function, it's iscombine! Just say true after the true/false for broadcast to set that flag as a Combine and hence, able to create rations! Now then, I can't load my schema, I can't find the cakevars.lua file in cfg, and it's apparently no where to be found. It's not a bug, it's just not there, do I have to make one or where should I be looking? And Bios, don't you dare flame me, because I actually know what the fuck I'm doing.
Sorry, you need to Log In to post a reply to this thread.