Jump to content

I am new


Kostis

Recommended Posts

Posted

Hello guys i just started learning .lua and i start reading from wiki is it ok, or you suggest me to read something else?

Thanks :)

I wish i could make a roleplay server one day :)

Posted

Hint: if you normally play Roleplay Servers, whenever you see a script, try to imagine (in your head) how you would do an equal. Try imagine the conditions (if/else), the variables... this will help you so much with the time.

Software Engineer & Entrepreneur Running Lustrel and VilarikA • Highly engaged on open source community

Posted
Hint: if you normally play Roleplay Servers, whenever you see a script, try to imagine (in your head) how you would do an equal. Try imagine the conditions (if/else), the variables... this will help you so much with the time.

here's an example:

if I point a gun at a police, then

I would get 1 star

done,

script now:

addEventHandler("onPlayerTarget",root,function(target) --When the player targets 
if(getElementType(target)=="player")then --get what they're pointing at and check if it's another player 
    if(getTeamName(getPlayerTeam(target))=="Police")then --get the the target(the player) team name, and if they're in the police team 
        setPlayerWantedLevel(source,1) --set their(the player that targeted) wanted level to 1 
    end 
end)--done 

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

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