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

Otswe Free Scripting Service (Actions/Movements/Creaturescripts) Open Again!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,286
Location
Sweden?
Cyko Free Scripting Service (Actions/Movements/Creaturescripts/Talkactions) ReOpen!

Hello,

I decide to make scripts depending on players request.

Why im doing this?
Ticket to hevean? <- Also helping people and learn the lua language.
Please post below and i will hopefully be able to make the script you desire.

I repon Otswe Free Scripting Service, Ill only accept medium hard scripts. Follow these rules and we are good to go!

Rule number 1: No Spamming!
Rule number 2: Be Patient!
Rule number 3: There is no rule number 3!
Rule number 4: Follow all these rules!

Asfar you can see i accept only Actions/Movements/Creaturescripts/Talkactions/Globalevents! But ill accept npcs to, but depends how hard the request is.
My scripting Corner! Here you will be able to find scripts :D

My Scripts:
Need Special Storage To Enter The Platform!
Open Secret Hole - Timer!
Fire Explosion Into Area!
Remove Swarms From Magical Bushs!
Simple Upgrade Item!
Automatic Cleaning Spefic Area!
Magic Wall With Countdown!
Premium Scroll!
http://otland.net/f81/anti-lure-monster-v-1-otswe-171236/
http://otland.net/f81/advance-tutorial-hints-script-easy-configure-170739/
http://otland.net/f81/house-system-171153/
http://otland.net/f82/update-automatic-currently-health-mana-172129/
Check Points - Advanced!

Older Scripts:
Simple Premium Tile!
Exp Token!
Throw item get teleported!
 
Last edited:
Cyko ,

I want to ask if You could Create a Script which:

Broadcast Message comes up every 2h saying " Fight Events Starts in 3 Minutes ... Write /join to Join the Event"
When the Player says "/join" it Teleports him to a Room.. There has to Be 4 Players Atleast
When the Events starts the Broadcast message comes up Saying "Fight Event Started"
And all People that Were in the Room are Teleported to an Arena
And They Have to Fight ...

When the Player dies it Says "You Lost!" and Teleports him Back to Temple
After all Players Dies and there is Only 1 Player Alive "winner" a Broadcast Message
Comes up saying "@Playername@ Has won the Fight Event and Recives a Reward. Congratulations!!"
and The player is Teleported back to Temple.

Ill Rep++ you

Waiting for Quick Reply
Thanks

Regards
 
@patriciou

This is a really huge request which i dont have time with. Im only doing medium fast scripts. Sorry.
 
Yeah ive seen this On but It doesnt Work :/

- - - Updated - - -

Well if It does work Could you Please add Broadcast Bit to it Please?

So that The Event Starts every 2h ?? Please

REP++ for Help
 
@patriciou i have to go now, ill login tomorrow and see what you posted. Also if someone else can help him, feel free to help.
 
I need an npc that changes the outfit of a player, but only if that player has a certain storage id.

Player - Hi
NPC - hello
Player - frog
(if player has quest done 'storage =30001'
NPC - You have turned into the outfit Frog. (outfit id 36)
(if player does not have quest done
NPC - You do not have the frog outfit





I need this npc because the tibia client is limited to 25 outfits. I want to make quests that give monster look-types for players to choose at anytime.

hopefully this npc can do more then 1 outfit as well!

inside outfits.xml I have this

XML:
	 <outfit id="36" quest="30001" premium="yes">
		<list gender="0-3" lookType="307" name="Mutated Bat"/>
	</outfit>

I also have an npc that gives you the storage value 30001
But the players cannot change their outfit because it is past outfit id 25 - which the client limits them too.
So I need this npc to change their outfit for them using keywords :eek:

Hopefully your able to make this <33

I wouldn't mind if it just changed their looktype to 307 either, but only if it checked for the storage value first!

Hey I made this a long while ago, which directly would help with what you want here:

http://otland.net/f81/monster-outfits-monster-outfits-quest-rewards-111210/

With that, you will just have a talkaction that lists all the monster outfits a player has, and they get them by having a storage value.. making it so the player doesn't have to visit the npc to get changed into the look type of the frog.


But if you really want the npc..

What kind of quest do you want the player to do to get the frog outfit?

I'll make it for you since it's pretty simple.
 
I tried taking what you had given me and putting into another person's work with a few edit's
this is what I came up with -

XML:
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 configs = {
        Storage = 30001,
		outfit = {lookType = 36}
 
        }
 
 
if(msgcontains(msg, 'outfit')) then
        if (getPlayerStorageValue(cid, configs.Storage) < 0) then
		selfSay('You have not done the quest for this outfit.', cid)
		talkState[talkUser] = 0
	else
		selfSay('Do you wish to change into the frog outfit?', cid) 
			talkState[talkUser] = 1
	end
		else
			if(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
					doPlayerAddOutfit(cid,configs.outfit)
					selfSay('You are now wearing the frog outfit.', cid)
					talkState[talkUser] = 0
                else
                	selfSay('You don\'t have all the items.', cid)
			talkState[talkUser] = 0
		end
 
	end
		return TRUE
	end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

In console it comes up with a error

Code:
data/npc/scripts/countblackulanewoutfit.lua:onCreatureSay
Description:
(luaDoPlayerAddOutfit) Player not found

Hopefully it helps? :p

Pretty much it checks to see if you have the storage id
then elevates you to a higher talk state and then upon saying yes, it would give you the outfit
but comes back with that error

- - - Updated - - -

Hey I made this a long while ago, which directly would help with what you want here:

http://otland.net/f81/monster-outfits-monster-outfits-quest-rewards-111210/

With that, you will just have a talkaction that lists all the monster outfits a player has, and they get them by having a storage value.. making it so the player doesn't have to visit the npc to get changed into the look type of the frog.


But if you really want the npc..

What kind of quest do you want the player to do to get the frog outfit?

I'll make it for you since it's pretty simple.

omg! that is tottaly better then my npc option! xD
 
@Cyko

Well There is None Errors But there is 1 Wrong Thing ....
Could you Add a Broadcast Part to It please ??
Because Players Dont know When the Event Starts
Can you edit it and make it so Every 2h it will say
"Last Man Standing Event Starts is 4 Minutes"
Then
"Last Man standing Event Started Good Luck"
and The Winner
"The Winner of the Event is "Name" Congratulations!!."

REP ++ for Help :)_
 
@Shiverflare try this:
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 configs = {
        Storage = 30001,
		outfit = {lookType = 36}
 
        }
 
 
if(msgcontains(msg, 'outfit')) then
        if (getPlayerStorageValue(cid, configs.Storage) < 0) then
		selfSay('You have not done the quest for this outfit.', cid)
		talkState[talkUser] = 0
	else
		selfSay('Do you wish to change into the frog outfit?', cid) 
			talkState[talkUser] = 1
	end
		else
			if(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
					doPlayerAddOutfit(cid,configs.outfit, 0)
					selfSay('You are now wearing the frog outfit.', cid)
					talkState[talkUser] = 0
                else
                	selfSay('You don\'t have all the items.', cid)
			talkState[talkUser] = 0
		end
 
	end
		return TRUE
	end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

- - - Updated - - -

@patriciou
I will take look on it soon.
 
i have problem with add /gain frags .. if someone kill player .. you murder ..etc but if u use !frags 0 day 0 week 0 month

Help Please!

i hope u understand me
 
i have problem with add /gain frags .. if someone kill player .. you murder ..etc but if u use !frags 0 day 0 week 0 month

Help Please!

i hope u understand me

Post your config.lua

- - - Updated - - -

@patriciou
Add this into Globalevents/scripts
Lua:
local config = {
	temporaryArea = {
		{x = 997, y = 1013, z = 7}, -- northwest corner of area where players must stand in order to join the event
		{x = 1001, y = 1015, z = 7} -- south east corner
	},
	arenaArea = {
		{x = 1003, y = 1009, z = 7}, -- nw corner of arena
		{x = 1015, y = 1019, z = 7}, -- se corner of arena
		{x = 1009, y = 1014, z = 7} -- center of arena
	},
	minPlayers = 2, -- min players required to start the battle
	prize = {2160, 5467} -- rewards
}

local cyko = {
block_pos = {x= 1000, y=1000, z=7},
block_itemid = 1484,
}
function cyko_block()
	if(getTileItemById(cyko.block_pos, cyko.block_itemid).uid == 0) then
		doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition)
	end
end
 
function cyko_remove_block()
	local item = getTileItemById(cyko.block_pos, cyko_block_itemid)
	if(item.uid ~= 0) then
		doRemoveItem(item.uid)
	end
end
 
function onThink(interval, lastExecution, thinkInterval)
	local players, arenaPlayers = {}, {}
	for x = (config.temporaryArea)[1].x, (config.temporaryArea)[2].x do
		for y = (config.temporaryArea)[1].y, (config.temporaryArea)[2].y do
			for z = (config.temporaryArea)[1].z, (config.temporaryArea)[2].z do
				if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then
					table.insert(players, getTopCreature({x = x, y = y, z = z}).uid)
				end
			end
		end
	end
	for x = (config.arenaArea)[1].x, (config.arenaArea)[2].x do
		for y = (config.arenaArea)[1].y, (config.arenaArea)[2].y do
			for z = (config.arenaArea)[1].z, (config.arenaArea)[2].z do
				if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then
					table.insert(arenaPlayers, getTopCreature({x = x, y = y, z = z}).uid)
				end
			end
		end
	end
	if(table.maxn(arenaPlayers) == 1) then
		doTeleportThing(arenaPlayers[1], getPlayerMasterPos(arenaPlayers[1]))
		doSendMagicEffect(getPlayerMasterPos(arenaPlayers[1]), CONST_ME_TELEPORT)
		doPlayerSendTextMessage(arenaPlayers[1], MESSAGE_STATUS_CONSOLE_BLUE, "You win a battle and recived your reward.")
		doPlayerAddItem(arenaPlayers[1], (config.prize)[math.random(1, table.maxn(config.prize))], 1)
		broadcastMessage(arenaPlayers[1], "Winner of last man standing is: "..getCreatureName(arenaPlayers[1])..".")
	elseif(table.maxn(arenaPlayers) < 1) then
		if(table.maxn(players) >= config.minPlayers) then
			for i = 1, config.minPlayers do
				doTeleportThing(players[i], (config.arenaArea)[3])
				doSendMagicEffect((config.arenaArea)[3], CONST_ME_TELEPORT)
				doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The battle begins. Survive for glory!")
			end
		end
	end
	return true
end

Now go to talkactios/talkactions.xml and add these lines below:
Code:
<talkaction log="yes" words="/lms" access="6" event="script" value="lms.lua"/>

Now add this into talkactions/scripts and create new lua and name it "lms"
Lua:
local cyko_open_text = "Last Man Standing Event Has Started"
local cyko_close_text = "Last Man Standing Event Has Closed"

function onSay(cid, words, param, channel)
	if(param == 'open') then
		cyko_remove_block()
		doBroadcastMessage(cyko_open_text)
	end
--////////////////////////////////////////////////--
	if(param == 'close') then
		cyko_block()
		doBroadcastMessage(cyko_close_text)
		end
	return true
end

Asfar ive added when someone win it should broadcast the winner name and when you want to start it you going to do /lms open or /lms close, it will remove the coal basin which blocking the teleport and close should add it back.
 
Last edited:
soo Ive done it as You said and i get 2 Errors

When i Say /lms Close This Comes up in my Console

PHP:
[Error - TalkAction Interface]
data/talkactions/scripts/lms/lms.lua:onSay
Description:
data/talkactions/scripts/lms/lms.lua:11: attempt to call global 'cyko_block' (a
nil value)
stack traceback:
        data/talkactions/scripts/lms/lms.lua:11: in function <data/talkactions/s
cripts/lms/lms.lua:4>

And when i say /lms open This comes Up

PHP:
[Error - TalkAction Interface]
data/talkactions/scripts/lms/lms.lua:onSay
Description:
data/talkactions/scripts/lms/lms.lua:6: attempt to call global 'cyko_remove_bloc
k' (a nil value)
stack traceback:
        data/talkactions/scripts/lms/lms.lua:6: in function <data/talkactions/sc
ripts/lms/lms.lua:4>


Waiting for Quick Reply :)

Regards..
 
Replace the talkactions:
Lua:
local cyko_open_text = "Last Man Standing Event Has Started"
local cyko_close_text = "Last Man Standing Event Has Closed"

local cyko = {
block_pos = {x= 1000, y=1000, z=7},
block_itemid = 1484,
}
 
function onSay(cid, words, param, channel)

function cyko_block()
	if(getTileItemById(cyko.block_pos, cyko.block_itemid).uid == 0) then
		doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition)
	end
end
 
function cyko_remove_block()
	local item = getTileItemById(cyko.block_pos, cyko.block_itemid)
	if(item.uid ~= 0) then
		doRemoveItem(item.uid)
	end
end

	if(param == 'open') then
		cyko_remove_block()
		doBroadcastMessage(cyko_open_text)
	end
--////////////////////////////////////////////////--
	if(param == 'close') then
		cyko_block()
		doBroadcastMessage(cyko_close_text)
		end
	return true
end
 
Last edited:
Ive done it And ...

When i Say /lms close I get this Error

PHP:
[Error - TalkAction Interface]
data/talkactions/scripts/lms/lms.lua:onSay
Description:
attempt to index a nil value
stack traceback:
        [C]: in function 'doCreateItem'
        data/talkactions/scripts/lms/lms.lua:13: in function 'cyko_block'
        data/talkactions/scripts/lms/lms.lua:30: in function <data/talkactions/s
cripts/lms/lms.lua:9>

And when i Say /lms open

> Broadcasted message: "Last Man Standing Event Has Started".

So Open one works but When i say close command the Block doesnt appear and i get this message

Waiting for Quick Reply

Regards..
 
Back
Top