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

item za kase

experienced

Intermediate OT User
Joined
Jan 13, 2011
Messages
418
Reaction score
102
Location
Poland
czesc chlopaki
potrzebuje skrypt na tp w ktore moze wejsc tylko druid a jak sorc knight czy pall wejdzie na tp to go odpycha 1 w tyl z napisem jakims
i zeby w tym skrypcie zwykla teleportacja byla w dane miejsce :p
 
Wszystkie funkcje masz opisane, jeśli nie umiesz tego dopsaować tut mir lejde. Alogytm wygląda tak:

jeśli druid wtedy teleportuj do xyz
w innym wypadku teleportuj obecnapozycia.x-1
 
Code:
function onStepIn(cid, item, frompos, item2, topos)
	if isDruid(cid) == FALSE then
		doMoveCreature(cid, frompos)
                doPlayerSendTextMessage(cid, 4, "TEKST.")
	return true
	end
end
 
Skrypt dziala w ten sposob, ze po wejsciu na teleport jesli nie jestes druidem to sie po prostu cofnie.
 
o lol ale zamulil przeciez to wiadomo .... a ten tlumaczy i mysli ze jest madry haha
ale chodzi mi tam zeby dodac jeszcze tp w miejsce jakies
 
o lol ale zamulil przeciez to wiadomo .... a ten tlumaczy i mysli ze jest madry haha
ale chodzi mi tam zeby dodac jeszcze tp w miejsce jakies


W map editorze mysle ze jak dodasz coordinates to powinno smigac.
Nie bede spinal bo szkoda slow na ciebie.
 
nie bede zakladal nowego tematu :O

mam taki skrypt
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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, 42344)
addon_need_premium = 'Sorry, you need a premium account to get addons.', cid
addon_have_already = 'Sorry, you already have this addon.', cid
addon_have_not_items = 'Sorry, you don\'t have these items.', cid
addon_give = 'Here you are.', cid
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
                              if msgcontains(msg, 'elvenhair rope') then
                              if getPlayerItemCount(cid,2152) >= 8 then
                                        selfSay('Do you want buy elvenhair rope for 8 000 gold ?', cid)
                                        talk_state = 1
                              else
                                        selfSay('You don\'t have money!', cid)
                                        talk_state = 0
                              end
                              elseif msgcontains(msg, 'yes') and talk_state == 1 then
                              talk_state = 0
                              if getPlayerItemCount(cid,2152) >= 8 then
                              if doPlayerRemoveItem(cid,2152, 8) == TRUE then
                              doPlayerAddItem(cid, 7731, 1)
                        selfSay('Here u are.', cid)
                              end
                              else
                                        selfSay(havent_item)
                              end
                                  elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Ok than.', cid)
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

i chce zeby lina byla za 8k ale jak wezmiesz 2152 to tylko siwymi mozna placic a chce zeby wykrywalo inne czyli ogolny koszt 8k a nie siwe tyko

:p
 
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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, 42344)
addon_need_premium = 'Sorry, you need a premium account to get addons.', cid
addon_have_already = 'Sorry, you already have this addon.', cid
addon_have_not_items = 'Sorry, you don\'t have these items.', cid
addon_give = 'Here you are.', cid
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
                              if msgcontains(msg, 'elvenhair rope') then
                              if player_money >= 8000 then
                                        selfSay('Do you want buy elvenhair rope for 8 000 gold ?', cid)
                                        talk_state = 1
                              else
                                        selfSay('You don\'t have money!', cid)
                                        talk_state = 0
                              end
                              elseif msgcontains(msg, 'yes') and talk_state == 1 then
                              talk_state = 0
                              if player_money >= 8000 then 
                              if doPlayerRemoveItem(cid,2152, 80) == TRUE then
                              doPlayerAddItem(cid, 7731, 1)
                        selfSay('Here u are.', cid)
                              end
                              else
                                        selfSay(havent_item)
                              end
                                  elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Ok than.', cid)
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


Ewentualnie, jesli nie potrzebujesz tych storage, sprawdzania pacc itp to zrob sobie plik nazwanpc.xml i wklej:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="jestemnoobemzmienmojeimie" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="134" head="57" body="59" legs="40" feet="76" addons="0"/>
	<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="shop_buyable" value="elvenhair rope,7731,8000"/>
	</parameters>
</npc>
 
Last edited:
A jak dalej nie trybi to poszukaj sobie scryptu na zasadzie "Enchanted Broni". Działa na takiej samej zasadzie.
 
dziex
ej Svetrey albo ktos inny co sie zna
jak dodac do tego skryptu storage czyli zrobic questa z tego
ze pisze hi elvenhair rope yes kupilem normalnie
ale za drugim razem jak napisze elvenhair rope to zeby pisalo 'juz robiles ten quest'
 
Back
Top