• 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!

self look

newlegend

Fear Me
Joined
Oct 18, 2009
Messages
146
Reaction score
0
Location
Australia
Hey otland i am here to ask people on otland if it's possible that they can make something that when a person looks at him self not only does it say the vocation but the level to please if thats possible?. :)
 
huH but isn't it like that already @ TFS???
EDIT: didn't notice this was at a wrong section :mad:
 
Last edited:
first this is the wrong section to request scripts, you have to go to Request & Support for this kind of request, now back to the topic, I believe it can be done with a CreatureEvent script 'onLook' it should be simple, well here is something I made, I don't think it might work but anyone can take it and make it better:
LUA:
function onLook(cid, thing, position, lookDistance)   
    if isPlayer(thing) then
        if getPlayerSex(thing) == 1 then
            sex = "He"
        else
            sex = "She"
		return doPlayerSendTextMessage(cid, "You see "..getCreatureName(thing)..", "..sex.." is a "..getPlayerVocationName(thing).." and "..sex.." is level "..getPlayerLevel(thing)..".")
        end
    end
return true
end
you also need to register it in login.lua that is located in data/creaturescripts/scripts/login.lua
and place it this in creaturescript.xml:
PHP:
<event type="look" name="PlayerLook" event="script" value="playerlook.lua"/>
so please don't throw a brick to my glass house if it doesn't work.
[Fixed]
 
Last edited:
i was looking for that on TFS 0.3.5 but it wasn't there.
EDIT:
:/ found it it was at the bottom under lua-made functions, Thanks anyways.
 
0.3.6pl1 ^^
sometimes the functions are hidden in c++ luascript.cpp
they are not shown in DOC/lua_functions but they work
 
and where can i find tfs 0.3.5 luascript.ccp at?? because if i know even other lua functions that are not there i can improve other scripts and such.
 
yes, it shows how are they made or how do they work
there are some hidden ones that might be useful
there are more in latest 0.3 ^^
 
That's a CreatureEvent Script so it goes in
data/creaturescript/scripts/[name of script].lua,
check my post and remember to register the event
in the login.lua, located in data/creaturescript
/scripts/login.lua, you have register it like this,
by adding this:
LUA:
registerCreatureEvent(cid, "PlayerLook")
where all the other creature events are registered at,
also like i said i don't know if it will work since I'm
not that good at making CreatureEvent Scripts, so if
it works then enjoy if it doesn't then I'm sorry.
 
here i think this will work the other one was never going to work due to some things i forgot to add.
P.S.
I think this might not work on a God since his sex = 2
LUA:
function onLook(cid, thing, position, lookDistance)  
    if isPlayer(thing) then
        if getPlayerSex(thing) == 1 then
            sex = "He"
        else
            sex = "She"
            if sex then    
		doPlayerSendTextMessage(cid, 25, "You see "..getCreatureName(thing)..", "..sex.." is a "..getPlayerVocationName(thing).." and "..sex.." is level "..getPlayerLevel(thing)..".")
	    end	
        end
    end
return true
end
 
LUA:
function onLook(cid, thing, position, lookDistance)  
    if not isPlayer(thing) then
        return true
    end
    return doPlayerSendTextMessage(cid, 25, "You see " .. getCreatureName(thing) .. ", " .. ((getPlayerSex(thing) == 1) and "he" or "she") .. " is a " .. getPlayerVocationName(thing) .. " and " .. ((getPlayerSex(thing) == 1) and "he" or "she") .." is level " .. getPlayerLevel(thing) .. ".")
end

register to xml + login
 
Back
Top