ijsf Posted January 14, 2007 Share Posted January 14, 2007 NOTICE: THIS TUTORIAL MAY BE OUTDATED! PLEASE READ: https://forum.multitheftauto.com/viewtopic.php?f=91&t=22270 This is our respond thread for our first weekly scripting tutorial. You can respond to the tutorial here if you have any questions, etc. Here's the link to the first tutorial: Scripting Tutorial I - User selectable warp points Link to comment
NeDizZ Posted January 14, 2007 Share Posted January 14, 2007 Uhm. That was short. =S Well, will be waiting for the next one. Link to comment
Raoul Posted January 14, 2007 Share Posted January 14, 2007 What program whas this script made? mIRC? Link to comment
Raoul Posted January 14, 2007 Share Posted January 14, 2007 oh i thought that was just the language and it whas made in another program Link to comment
Hedning Posted January 14, 2007 Share Posted January 14, 2007 oops, Lua is the language BUT you can write this in notepad! or Luaedit. Q: Can I put this script in gta sa and play with it in SP? if so, how? Link to comment
Raoul Posted January 14, 2007 Share Posted January 14, 2007 (edited) That's what i was looking for Thanks Edited January 14, 2007 by Guest Link to comment
MTA Team Blokker_1999 Posted January 14, 2007 MTA Team Share Posted January 14, 2007 oops, Lua is the language BUT you can write this in notepad! or Luaedit.Q: Can I put this script in gta sa and play with it in SP? if so, how? No, since you need MTA to run it. Link to comment
driver2 Posted January 14, 2007 Share Posted January 14, 2007 Maybe I'm just stupid right now, but if another player than the one who created the teleporter steps into it and triggers the 'Script_onPlayerClick' Function, will it not beam the owner of the teleporter to the destination? Link to comment
Brophy Posted January 14, 2007 Share Posted January 14, 2007 LOL @ some of the posts, its like they have stared at the tutorial / past months news but not actually read it What program whas this script made? mIRC? LOL Link to comment
ijsf Posted January 14, 2007 Author Share Posted January 14, 2007 Maybe I'm just stupid right now, but if another player than the one who created the teleporter steps into it and triggers the 'Script_onPlayerClick' Function, will it not beam the owner of the teleporter to the destination? I assume you mean the onMarkerHit event, not the onPlayerClick event. Have a look at the function that warps you: [lua]setElementPosition ( player, x, y, z )[/lua] And the event function itself: [lua]function Script_onMarkerHit ( player )[/lua] This means it'll warp whoever triggered the event. Link to comment
driver2 Posted January 14, 2007 Share Posted January 14, 2007 I thought only the creator of the warper should be teleported. Link to comment
Guest Posted January 14, 2007 Share Posted January 14, 2007 where I can get LUA soft? plz give me a link to a needed version Link to comment
driver2 Posted January 14, 2007 Share Posted January 14, 2007 (edited) You don't need any software besides an ordinary text-editor to write Lua. To run scripts you can use a standalone interpeter. But of course you won't be able to test MTA related Lua scripts without MTA. http://lua.org http://lua-users.org Edited January 14, 2007 by Guest Link to comment
Brophy Posted January 14, 2007 Share Posted January 14, 2007 What? if you wanna make scripts use notepad, notepad++ or luaedit, want the links? then google them Link to comment
Guest Posted January 14, 2007 Share Posted January 14, 2007 driver2, thanx for info, but I've already downloaded LUAedit. I can open , edit and compile lua files with it. ----------------------------------------- Good tutorial. And added video is great. So we can create our own scripts, but can't test them? One thing we needed too is 1-2 player server+client to test scripts. Link to comment
MTA Team Blokker_1999 Posted January 14, 2007 MTA Team Share Posted January 14, 2007 MTA:SA has a built in interpreter, you won't need to compile anything when you write scripts for MTA. Link to comment
orappa Posted January 14, 2007 Share Posted January 14, 2007 Uhm. That was short. =S These are only examples. They're meant to be as simple as possible. We won't be showing complicated game modes with hundreds of lines of code. Link to comment
Convirion Posted January 14, 2007 Share Posted January 14, 2007 So if you could strip down al the mta scripting, could you make it work for just gta? would be some kind of fun. btw nice tut! Link to comment
MrJax Posted January 14, 2007 Share Posted January 14, 2007 It would be possible for us to make a single-player mod for MTA, which would just start the game normally, but also give access to a lot of features that aren't specific to multiplayer, including scripting, but I think we'll just be improving deathmatch for a while. Link to comment
Aeron Posted January 15, 2007 Share Posted January 15, 2007 What program whas this script made? mIRC? Yes, this is clearly mIRC-style scripting ...not oops, Lua is the language BUT you can write this in notepad! or Luaedit.Q: Can I put this script in gta sa and play with it in SP? if so, how? I won't recommend Luaedit, it wiped my scripts directory 2 times. The directory contained very advanced scripts which where EXTREMLY fun. QA Team knows Edit: What's up with the new 'onResourceLoad', do I have to change my scripts AGAIN? Link to comment
BTH Posted January 15, 2007 Share Posted January 15, 2007 addEventHandler should take a function instead of an string imo. Link to comment
Robix Posted January 15, 2007 Share Posted January 15, 2007 Hmm it's similar to the gmod LUA scripting.I'm waiting now for script for WEapons. Link to comment
Guest Posted January 15, 2007 Share Posted January 15, 2007 I've got another question. [lua] addEventHandler ( "onMarkerHit", getRootElement(), "Script_onMarkerHit" ) function Script_onMarkerHit ( player ) [/lua] How can i define which variables are passed to the function by the event handler? Or how do i know which variables are passed by existing event handlers? Maybe a little too indepth for this tutorial, this is probably something for later tutorials. Link to comment
Recommended Posts