• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Scripter I am trying to find a teacher

cooldodo

New Member
Joined
Jan 17, 2014
Messages
297
Reaction score
4
teach me scripts like to be good at them like to figure whats wrong in that script and how to create scripts i am 17 years old really wanna learn had my own server but got bored i wanna learn scripting thanks :D
 
THANKS i will go learn from there but i want someone to go step by step like ask him is that right i know its hard to find someone and do it for free cuz its a waste of time with him
Nobody will always have time for you. You gotta learn by yourself and the link provides you with just what you might need as a beginner. If you get stuck somewhere just open a thread in the support forums :)
 
Nobody will always have time for you. You gotta learn by yourself and the link provides you with just what you might need as a beginner. If you get stuck somewhere just open a thread in the support forums :)
@Evan @Ninja and @Limos teached me.
Start with their Tutorials, best ever.
Do a script similar with tutorial and if its not working. Ask about in support.
 
if u need nice teacher so u must call limos "best one here and best teacher im coming here noob 0 idea about anything now i can do alot of things and there alot ppl i helped him and you one from them " again best teacher here limos
 
if u need nice teacher so u must call limos "best one here and best teacher im coming here noob 0 idea about anything now i can do alot of things and there alot ppl i helped him and you one from them " again best teacher here limos
ok thx
 
My tip is to skip tutorials on otland, there is pretty much nothing good in them except what you can do with the functions.
Search for lua on google, there you will find better ways and alot more things about lua itself.
Once you can write simple programs in ex: www.lua.org/cgi-bin/demo

Then you can start looking into luascript.cpp, you will find all of your source listed functions there.
After that you have your global.lua / library files to read aswell to see functions that are not listed in your source code.
 
My tip is to skip tutorials on otland, there is pretty much nothing good in them except what you can do with the functions.
Search for lua on google, there you will find better ways and alot more things about lua itself.
Once you can write simple programs in ex: www.lua.org/cgi-bin/demo

Then you can start looking into luascript.cpp, you will find all of your source listed functions there.
After that you have your global.lua / library files to read aswell to see functions that are not listed in your source code.
that's 2nd step imo.
But yeah good thing too.
After you learn the luascript.cpp You can start doing PERFECT functions to Global.lua

And ALL your things what you wana add to game are 1 liners :D (OP !! makes making ot very easy to config)
 
that's 2nd step imo.
But yeah good thing too.
After you learn the luascript.cpp You can start doing PERFECT functions to Global.lua

And ALL your things what you wana add to game are 1 liners :D (OP !! makes making ot very easy to config)

Well not really, the thing I wanted to get out(as I suppose you have no experience with) is that the functions are listed in the luascript.cpp file.
https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L2172
If ex. you read that you would know there is a function with the class Creature named getHealth, if you then go to:
https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L7725
We can now see it does not require any parameters.

And I said "looking into" not "After you learn the".
 
Well not really, the thing I wanted to get out(as I suppose you have no experience with) is that the functions are listed in the luascript.cpp file.
https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L2172
If ex. you read that you would know there is a function with the class Creature named getHealth, if you then go to:
https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L7725
We can now see it does not require any parameters.

And I said "looking into" not "After you learn the".
i know but i said after you learn the. because that what exactly happens with your scripting if you start learn all these luascripts.cpp functions
 
i know but i said after you learn the. because that what exactly happens with your scripting if you start learn all these luascripts.cpp functions
mr_bean_what___meme_by_josael281999-d81mvxb.png


So if I read the luascript.cpp file I will automatically write scripts like this?
Code:
function onSmth() local player = Player(cid) if(not player) then return false end print(player:getName(), player:getHealth()) end

And I also told him to read up on lua first, he will notice things like indentation aswell as things about statments, boolean, nil, etc etc
 
mr_bean_what___meme_by_josael281999-d81mvxb.png


So if I read the luascript.cpp file I will automatically write scripts like this?
Code:
function onSmth() local player = Player(cid) if(not player) then return false end print(player:getName(), player:getHealth()) end

And I also told him to read up on lua first, he will notice things like indentation aswell as things about statments, boolean, nil, etc etc
yeah, but custom functions constructed from lua meta functions
 
yeah, but custom functions constructed from lua meta functions

Could you explain abit more? :p
Not really understanding you.
Are you talking about using old functions on 1.1?
Code:
function getThing(player)
     return player:thing()
end

Or that he would over write functions with global.lua?
 
Could you explain abit more? :p
Not really understanding you.
Are you talking about using old functions on 1.1?
Code:
function getThing(player)
     return player:thing()
end

Or that he would over write functions with global.lua?
Example:
Code:
---------- SYSTEMS
    if msgcontains(msg, 'trade') then
        shopSystem(cid, getTable(Player(cid)))
    end
   
    if msgcontains(msg, 'mission') then
        noMissions = exploreMissionsSystem(cid, exploreMissions, noMissions)
        noMissions = collectingMissionsSystem(cid, collectingMissions, noMissions)
        noMissions = dailyExploreMissionsSystem(cid, dailyExploreMissions, daily, noMissions)
        missionBoolean(cid, noMissions)
    end

    if msgcontains(msg, "report") then
        noReport = reportExploreMissions(cid, exploreMissions, dailyExploreMissions, noReport)
        noReport = reportExploreDailyMissions(cid, dailyExploreMissions, noReport)
        noReport = reportCollectingMissions(cid, collectingMissions, noReport)
        findNewMission(cid, collectingMissions)
        for k,v in pairs(collectingMissions) do
            if getPlayerStorageValue(cid, collectingMissions[k].storageId) ~= -2 then
                daily = false
            end
        end
        if daily then
            findNewMission(cid, dailyExploreMissions, daily)
        end
        reportBoolean(cid, noReport)
    end
Whenever want mission type for him i just add 1 new line of one of these custom scripts.
Since the luascript.cpp are going deep into basic its easy to make these functions to work.

This used to be ~300-400 lines long scripts now its ~30-40 lines

If you look the luascript.cpp choose a method and find the function. You will same thing.
 
Example:
Code:
---------- SYSTEMS
    if msgcontains(msg, 'trade') then
        shopSystem(cid, getTable(Player(cid)))
    end
  
    if msgcontains(msg, 'mission') then
        noMissions = exploreMissionsSystem(cid, exploreMissions, noMissions)
        noMissions = collectingMissionsSystem(cid, collectingMissions, noMissions)
        noMissions = dailyExploreMissionsSystem(cid, dailyExploreMissions, daily, noMissions)
        missionBoolean(cid, noMissions)
    end

    if msgcontains(msg, "report") then
        noReport = reportExploreMissions(cid, exploreMissions, dailyExploreMissions, noReport)
        noReport = reportExploreDailyMissions(cid, dailyExploreMissions, noReport)
        noReport = reportCollectingMissions(cid, collectingMissions, noReport)
        findNewMission(cid, collectingMissions)
        for k,v in pairs(collectingMissions) do
            if getPlayerStorageValue(cid, collectingMissions[k].storageId) ~= -2 then
                daily = false
            end
        end
        if daily then
            findNewMission(cid, dailyExploreMissions, daily)
        end
        reportBoolean(cid, noReport)
    end
Whenever want mission type for him i just add 1 new line of one of these custom scripts.
Since the luascript.cpp are going deep into basic its easy to make these functions to work.

This used to be ~300-400 lines long scripts now its ~30-40 lines

If you look the luascript.cpp choose a method and find the function. You will same thing.


No offence but you did not do as I explain in that case.
While you are learning about lua you will learn things like if statments, the if, elseif, else etc.
And I still don't get how and why you not nest your statments if you read the luascript.cpp file?
They also nest the statments if it is needed, diffrence is how they are written out:
Code:
if(thing) {
    x
} else if(anotherThing) {
    y
} else {
    z
}

Code:
if(thing) then
    x
elseif(anotherThing) then 
    y
else
    z
end
 
No offence but you did not do as I explain in that case.
While you are learning about lua you will learn things like if statments, the if, elseif, else etc.
And I still don't get how and why you not nest your statments if you read the luascript.cpp file?
They also nest the statments if it is needed, diffrence is how they are written out:
Code:
if(thing) {
    x
} else if(anotherThing) {
    y
} else {
    z
}

Code:
if(thing) then
    x
elseif(anotherThing) then
    y
else
    z
end
because i dont want to?
 
Lua is a very easy programming language to learn and IMO a good language to get into the field in general.
It has a simple syntax and a small standard lib. The #1 mistake I see people in the Tibia community do is never learn the language in the first place.
They simply copy and paste community code and use bruteforce trial and error until it works.
Take the time to learn the language and grasp the concepts of programming, you'll thank yourself for it.
After you learn the language then you can learn the nuances of TFS and it's functions.

If you know another language or the concept of programming:
http://learnxinyminutes.com/docs/lua/

More detailed guide to Lua (5.0) worth at least one complete read-through
http://www.lua.org/pil/contents.html

Standard Lua 5.1 reference:
http://www.lua.org/manual/5.1/

Metatables (check out his other articles, very interesting stuff)
http://nova-fusion.com/2011/06/30/lua-metatables-tutorial/
 
thanks guys :D i am trying to learn but still cant find any good example on google xD
 
Back
Top