Jump to content

SAM Turrent


Sir.BEEF

Recommended Posts

Hi guys i wanted to ask how to make Sam Torrent script, where you put it on staff base to shoot players who tries to go there (We dont want anyone to see while we are talking on localchat).

tell me how to start it and give me some codes please if its hard just tell me and when i get trained more ill think about it.

Link to comment
This forum is for helping people in need. It is NOT to make resources for you.

lol i didnt ask anyone to make a script i just want him to make it in a code so it wont be so messy. if you dont wanna help dont post.

Asking for code is indirectly asking to script.

If you really want to learn, go to the wiki,see what functions can be used for your resource, still don't get any idea? Go to the community and see if you can find a script which you want and lokk what the developer used in it.

Creating Sam turret is easy, you need to make a colhape( i prefer colSphere) and use createWeapon, setWeaponTarget, fireWeapon as bonus said or you can use createProjectile.

But if you use createProjectile, be sure the creator is either localPlayer or his vehicle , check out wiki for more!

Link to comment
projectile createProjectile ( int 19 [, float posX, float posY, float posZ, float force = 1.0, element target = nil, float rotX, float rotY, float rotZ, float velX, float velY, float velZ, 3267 
end 
bool setWeaponTarget ( weapon rocket (simple), element theTarget [, int theComponent = 255] ) 
bool fireWeapon ( weapon rocket (simple)) 
  

Link to comment
projectile createProjectile ( int 19 [, float posX, float posY, float posZ, float force = 1.0, element target = nil, float rotX, float rotY, float rotZ, float velX, float velY, float velZ, 3267 
end 
bool setWeaponTarget ( weapon rocket (simple), element theTarget [, int theComponent = 255] ) 
bool fireWeapon ( weapon rocket (simple)) 
  

Did you just copy the thing out of wiki? You don't need either to input the datatypes nor the optional arguments... see the examples in the wiki,

A sample projectile can be like this...

createProjectile(localPlayer,20 ,posX,posY,posZ,1.0,localPlayer) 
--For the sake of simplicity i removed other optional arguments 
-- it works in this way : 
--createProjectile( creator of projectile, the weapon id it'd represent,now optional arguments[ the three position cords,force of projectile,the target (has to be a player)] 

I recommend you to have a look at Basic scripting tutorial by MadeX before proceeding with scripting.

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...