Jump to content

MG nest


5150

Recommended Posts

is there a script to create a minigun and have it move left to right (back and forth), or have it trail a player in a certain team (only hit if the player stops) while it shoots? so basically a moving, firing minigun that will trail a player in the Americans team... [its for a World War 2 server im working on, and i want autofiring miniguns for the D-Day beach bunkers]

please let me know if im not making sense... i feel like im not. this video explains what i mean by trailing:

Link to comment

yeah... you arent really understanding. i need a script that will create a minigun and rotate according to where the player moves. the video was just to show you what i meant by "trailing" the player (in the sense that the bullets will not be on-point accuracy, they will have to catch up to the player)

Link to comment
  • Moderators

I probably can figure out what is required to make it. But if you want my help with a complex script like this, you need at least the basic knowledge of lua and you have to start trying making it yourself. That are my two requirements for help with complex resources.

Link to comment

fine. i found a script on wiki that is similar but i dont know why it doesnt work. just check it for me

function arma() 
    minigun = createWeapon("minigun", 1, 1, 3)--Create the weapon 
    setWeaponClipAmmo(minigun, 99999) 
        setWeaponState(minigun, "firing") 
    setWeaponProperty(minigun, "fire_rotation", 0, -30, 0) 
    dueno = getWeaponOwner(minigun)--This gets the owner 
    outputChatBox(tostring(dueno))--And this say it in the chatbox 
end 
addCommandHandler("weapon", arma)--CommandHandler 

i changed the weapon owner (dueno) to my account name (guitarist5150) and set the coordinates to where i was standing but no luck.

also is there a way for infinite ammo? instead of 9999

Link to comment
  • Moderators

  • setWeaponOwner has been disabled(This function was disabled in revision r4872. ) https://wiki.multitheftauto.com/wiki/SetWeaponOwner Not sure if it is still disabled.
  • The code you show now doesn't turn the minigun to your direction.
  • You can't give it infinity ammo, but you can fake that by increase the value of setWeaponClipAmmo.
  • 'owner (dueno) to my account name (guitarist5150)' How? Dueno must be a userdata value from the player, the account name isn't enough.
  • "outputChatBox(tostring(dueno))--And this say it in the chatbox" Dueno isn't a name, but the userdata value of a player. Or false/nil if the player doesn't exist.

A userdata value is a specific ID that the server gives to elements. As you know a computer doesn't think like we do.

They use ID's to prevent double naming.

Example what would happen when we would use names instead of id's/userdata's:

In the real world there are a lot of people named as 'Peter'. If there are 4 players in the server with the name 'peter', it probably can't figure out which player to kick or it will just simply kick them all.

Same goes for other elements types like objects/vehicles/peds/markers etc. they all have userdata(id's) values.

Link to comment
  • Moderators

You should trying to understand it. And learn some basic lua on other sites.

Those lines you posted here are not even close to what you want to make.

What you atleast need to look at are:

Variables, what are they And how do they look like?

Function, what are they.........

Link to comment

i know basic scripting and some meanings, im still learning how to put it all together though. like, i could make a gate script (simple and complex), a script to create an object or ped and give the ped a weapon, animation, or clothing... i could edit scripts just fine as well, but its harder for me to create scratch ones

Link to comment
  • Moderators

I synced custom weapons on vehicles of choice a long time ago and I do not regret making it. Fixed all weapon bugs(damage) by creating overwrites.

A good end result can be reached(without further development of the MTA team), so I see no reason why he should not too. The only thing he might have trouble with, is making it actuality turn.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...