• Content count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About Forthwind

  • Rank

Recent Profile Visitors

305 profile views
  1. [QUESTION] Couple Scripting Questions

    1. You can either make a table such as: myTable = { [1] = [itemID, x, y, z), [2] = [itemID, x, y, z), --etc } function spawnObject() number = math.random(1, 2) -- First item and last item in table createObject(myTable[number][1], myTable[number][2], myTable[number][3], myTable[number][4]) end -- add some edits to make it loop whatever times you want it to loop, to spawn said items or, if you're working on a flat surface where z is always the same you can do: createObject(itemID, math.random(x first side, x other side), math.random(y first side, y other side), z) Althrough I would recommend using the first method as you got full control. 2. Haven't really had any experience with this but I'm suggesting you to read the wiki about getElementsByType.

    Ipairs loops through all the rows of your table, with your code you only told the loop to create a vehicle for row 1 in your table. I remade the code my way, hope it'll help. vehicleList = { [1] = {422, -2409.80029, -598.06927, 132.64844}, [2] = {422, -2425.80981, -602.30896, 132.56250}, } function spawnCar() for i, v in ipairs(vehicleList) do veh = createVehicle(vehicleList[i][1], vehicleList[i][2], vehicleList[i][3], vehicleList[i][4]) end end addCommandHandler("spawncarz", spawnCar) i = index, meaning that when the loop starts it'll first go through everything in the first row of the table (this time it's [1], then it'll go through everything in the second row [2], etc. That's why I'm using vehicleList[(i)], because it'll first be 1, and when the loop completes the first section in the table, it'll become 2.
  3. requset simple script for free [gang system]

    I'll put something together for you, will PM you lateron tonight.
  4. You shouldn't get mad if someone steals your work, considering you stole it from owlgaming and modified 1%.
  5. [Roleplay] Legacy Roleplay [English]

    Give this guy a break. Yes the server is using leaked/stolen Owl scripts but at least he's improving it/customising the scripts. Althrough this doesn't justify his actions, it's a step in the right direction. We've seen and heard it all, a couple of servers starting from scratch and building their own roleplay gamemode in the course of 1-2 years. And... What happened to those servers? They had a lifespam of 2 weeks. It's not worth the risk. In MTA Roleplay it's as the following: You build your own RP gamemode from scratch: It fails. Build it from an already existing popular but stolen gamemode: It succeeds (F*ck logic right?). Owlgaming is dieng as the developers are putting more effort into their GTA 5 gamemode than in their already existing server, players are therefore looking for something that's new, stable, shows organisation/new ideas and shows somewhat of a capable scripting team (as you also got a lot of owl copies with people claiming they can script and showing 0 progress in months of time). Well, they found it here and they're happy with it.
  6. So I'm trying to use my script to transfer a variable from server side to client side, it's going to be placed in a dx. Yet whatever I've tried so far resulted in an error, along with involving an experienced friend who also wasn't able to find the error. Anyway the script is as following: Server side: function Position (thePlayer) local root = getRootElement() spawnPlayer (source, -1756.2720947266, 787.56939697266, 167.65625, 0, math.random(0,288), 0, 0) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler( "onPlayerJoin", getRootElement(), Position ) function startgame(playerSource) actualtimer = setTimer(outputChatBox, 100000, 1, "Life is gut") setElementData(playerSource, "countdowntimer", actualtimer) end addCommandHandler( "countdown", startgame )] -- client function transferhandler() outputChatBox ("countdown") end addEventHandler("onClientRender", root, function(timer) dxDrawRectangle(313, 242, 378, 55, tocolor(5, 0, 0, 149), false) countdown = (getTimerDetails(getElementData(getLocalPlayer(), "countdowntimer"))/1000) dxDrawText("Game starts in:" .. countdown .. "seconds!", 323, 258, 646, 280, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end ) addEvent( "StartEvent", true ) addEventHandler( "StartEvent", getRootElement(), countdown ) These are the errors I'm getting: When I start the resourse: When I write the command /countdown (to start the countdown, variable that's going to be transferred. Lastly, those errors are equal to these lines in the script: Client.lua:30 is this line: countdown = (getTimerDetails(getElementData(getLocalPlayer(), "countdowntimer"))/1000) So the transfer is working fine, just the clientside part isn't.