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

Habdel.lua First Oriental Addon

druidbacu

New Member
Joined
Sep 15, 2011
Messages
60
Solutions
1
Reaction score
1
Witam mam do was prośbę jak zrobić żeby ten npc odpisywał tylko płci Male (męskiej). Na pewno jest to kwestia jednej linijki ale nie wiem jakiej ;/ będę bardzo wdzięczny a oto ten Skrypt.

Lua:
local keywordHandler = KeywordHandler:new() 
local npcHandler = NpcHandler:new(keywordHandler) 
NpcSystem.parseParameters(npcHandler) 
local talkState = {} 
local Topic = {} 
function onCreatureAppear(cid)                          npcHandler:onCreatureAppear(cid) end 
function onCreatureDisappear(cid)                       npcHandler:onCreatureDisappear(cid) end 
function onCreatureSay(cid, type, msg)                  npcHandler:onCreatureSay(cid, type, msg) end 
function onThink()                                      npcHandler:onThink() end 
function creatureSayCallback(cid, type, msg) 
        if(not npcHandler:isFocused(cid)) then 
                return false 
        end 
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid 
    local storage = getPlayerStorageValue(cid, 23112) 
 
    if msgcontains(msg, 'outfit') then 
			if storage == -1 then
            npcHandler:say("My scimitar? Yes, that is a true masterpiece. Of course I could make one for you, but I have a small request. Would you fulfil a task for me?", cid) 
            Topic[talkUser] = 1
			else
			npcHandler:say("Sorry invalid sex, go Ishina", cid) 
			end
			
	elseif msgcontains(msg, 'yes') and Topic[talkUser] == 1 then
            npcHandler:say("Listen, um... I know that Ishina has been wanting a comb for a long time... not just any comb, but a mermaid's comb. She said it prevents split ends... or something. ...", cid)   
			npcHandler:say("Do you think you could get one for me so I can give it to her? I really would appreciate it.", cid)  
			Topic[talkUser] = 2
			
    elseif msgcontains(msg, 'yes') and Topic[talkUser] == 2 then 
             npcHandler:say("Brilliant! I will wait for you to return with a mermaid's comb then.", cid) 
            Topic[talkUser] = 0
			setPlayerStorageValue(cid, 23112, 1)
	end
	    
    return TRUE 
end 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
if getPlayerSex(cid) == 1 then -- to jesli mezczyna

elseif getPlayerSex(cid) == 0 then -- to jesli jest kobieta

end


zamiast else dalem elseif, bo GM ma chyba plec 2 xd



aaa to patrz

na początku skryptu tuż pod
Lua:
if(not npcHandler:isFocused(cid)) then 
                return false 
        end

wklej:
Lua:
if getPlayerSex(cid) == 0 then
return false
end
 
@seminari no patrz czyli jednak istnieje coś takiego jak getPlayerSex a mówiłem o tym znajomemu to mnie wyśmiał bo chciałem yellera pomóc mu robić który by wrzeszczał zależnie od płci postaci ;)
 
@seminari no patrz czyli jednak istnieje coś takiego jak getPlayerSex a mówiłem o tym znajomemu to mnie wyśmiał bo chciałem yellera pomóc mu robić który by wrzeszczał zależnie od płci postaci ;)

bo Twój kolega to idiota i pewnie nie wie, że SEX to po angielsku płeć tylko stosunek płciowy, pierdolo9ny debil, zgnęb go za mnie

#temat
pytałeś na gg, też odpisałem tam Ci

to sprawdza czy jest kobietą i robi return false, czyli przerywa dalsze działanie skryptu, jeśli ktoś jest kobietą ;p
 
Back
Top