5150 Posted November 11, 2015 Share Posted November 11, 2015 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
Moderators IIYAMA Posted November 11, 2015 Moderators Share Posted November 11, 2015 This is not the right section to post this, the resource section should make more sense. But you are lucky that I know a resource that can do that: https://community.multitheftauto.com/in ... ils&id=233 But this has nothing to do with miniguns, those are simply rockets flying to a location. Link to comment
5150 Posted November 11, 2015 Author Share Posted November 11, 2015 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 IIYAMA Posted November 11, 2015 Moderators Share Posted November 11, 2015 Well afaik, that kind of script isn't yet on the community. Link to comment
5150 Posted November 12, 2015 Author Share Posted November 12, 2015 i do not want something from the community... i could just find that myself. i want to see who can help me create it Link to comment
Moderators IIYAMA Posted November 12, 2015 Moderators Share Posted November 12, 2015 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
5150 Posted November 12, 2015 Author Share Posted November 12, 2015 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 IIYAMA Posted November 12, 2015 Moderators Share Posted November 12, 2015 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
5150 Posted November 12, 2015 Author Share Posted November 12, 2015 ahh ok. so theres a ton of things wrong with that lol. ok, well is it worth the time to edit this script or should i just make a new one Link to comment
Moderators IIYAMA Posted November 13, 2015 Moderators Share Posted November 13, 2015 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
5150 Posted November 13, 2015 Author Share Posted November 13, 2015 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
Einheit-101 Posted November 14, 2015 Share Posted November 14, 2015 Created custom weapons arent synced and bugged and whatever man, dont even try to do this.... Someone started implementing something ages ago (like many things in MTA) and abandoned it unfinished. MTA development has almost stopped anyway... Link to comment
Moderators IIYAMA Posted November 14, 2015 Moderators Share Posted November 14, 2015 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
5150 Posted November 14, 2015 Author Share Posted November 14, 2015 all i want is a minigun that will shoot and rotate, and can be placed with coordinates.... i didnt know it was this hard Link to comment
Moderators IIYAMA Posted November 14, 2015 Moderators Share Posted November 14, 2015 It is code from scratch, Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now