Scripts / Please I need syntax for a quitgame script.

Author
Message
Meows
12
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 17th Dec 2016 13:36
I went to global.lua and it says

so I THOUGHT, ( so much for thinking ) this should be easy so I wrote this
quitgame.lua
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th Dec 2016 17:22
Try it without the e, i.e. QuitGame()

Note that the commands are case sensitive.
Been there, done that, got all the T-Shirts!
PM
Meows
12
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 18th Dec 2016 03:03
Quote: "AmenMoses:: Try it without the e, i.e. QuitGame()"


I did and got this

receive error attempt to call global "quitgame" (a nil value)
quitgame.lua
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 18th Dec 2016 09:21 Edited at: 18th Dec 2016 09:22
1. The sendmessage line is what the hard coding of lua does when you use the command in a script, it does not go in the script.

2. Its QuitGame() not quitgame(e), note tga capital letters Q and G, and no e, the e donated the entity and tells the entity to do something, you don't want the entity to quit the game, you want the game to quit the game, so you leave the brackets empty.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
Meows
12
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 18th Dec 2016 11:25
wow that didn't work either.. are we sure this is included in the compiled version?

Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 18th Dec 2016 11:31
Firstly you still have the sebdmessage li e in there, take it out. Secondly why are you putting semi Colons at the beginning and end of lines? Gg lua doesn't use semi colons, its not C#.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 18th Dec 2016 15:15 Edited at: 18th Dec 2016 15:15
You're going to need to read a guide on scripting as there's quite a bit wrong with your code but it should look like this.

No idea if it works though, those commands are more for Lee's menu rather than actual gameplay.
You might be better off with just killing the player or calling the next level (depending what you want to happen)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
warlock12
7
Years of Service
User Offline
Joined: 12th Sep 2016
Location: Argentina
Posted: 19th Dec 2016 13:16
SmallG... "The Great Teacher"...
The game is a serious thing (El juego es una cosa seria)

Login to post a reply

Server time is: 2024-05-21 20:31:02
Your offset time is: 2024-05-21 20:31:02