• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction +[Action] Basic Flysystem

Ecstacy

Mothafuckaaa
Joined
Dec 26, 2008
Messages
3,836
Reaction score
108
Location
The Netherlands

Because I don't need this script anymore, I'm releasing it.


  • What does this do?

This script will make you "fly".
Or that's a simple word for it.

It makes you fly to another floor, if it has itemid 460.


  • What does it check for?

When you type '/flyup' it checks if the floor above you is itemid 460(void), so that you can't fly on any tile.
If you are mounted(have storageValue)

On '/flydown' it checks for:
  1. Water
  2. If it is a house that you fly down to.
  3. If you are currently on 'air'(void(itemid 460)) so you can't use this when you are on normal ground, etc..
  4. Wether you are flying or not.
  5. If you are on 'z=7' (to prevent flying in caves)

  • How does this work?

It works only if you give areas you want to be able to be flown itemid 460(in a map editor).
You may only mount or type 'flyup' on 'z=7'.​


  • [*]Action - Mounting​

This only works for ONE item!

Code:
local t =   {
	[150] = {outfit='mew', text='Fly, mew!', dtext='Go down, mew!'}
}       
local thisCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(thisCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(thisCondition, {lookType = 354, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v, r, s = getCreaturePosition(cid), t[item.itemid], 100
	local pos = {x = v.x, y = v.y, z = 6}
	local posd = {x = v.x, y = v.y, z = 7}
	if r then
		if v.z == 7 then
			if getTileItemById(pos, 460).uid > 0 then
				if doTeleportThing(cid, pos, false) then
					doSendMagicEffect(pos, 10)
					doCreatureSay(cid, r.text, 19)
					return doAddCondition(cid, thisCondition)
				else
					return doPlayerSendCancel(cid, 'You can\'t fly here.')
				end    
			else
				return doPlayerSendCancel(cid, 'You can\'t fly here.')
			end
		elseif v.z == 6 then
			if doTeleportThing(cid, posd, false) then
				doSendMagicEffect(posd, 10)
				doCreatureSay(cid, r.dtext, 19)
				return doRemoveCondition(cid, CONDITION_OUTFIT)
			else
				return doPlayerSendCancel(cid, 'You can\'t land here.')
			end
		else
			return doPlayerSendCancel(cid, 'You can\'t fly here.')
		end
	else
		return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
	end
end

action.xml
Code:
<action itemid="[B]ITEM_ID IN SCRIPT[/B]" event="script" value="[B]SCRIPT_NAME[/B].lua"/>


  • how to edit:
At this part
Code:
[150] = {outfit='mew', text='Fly, mew!', dtext='Go down, mew!'}

edit this

Code:
[ITEMID] = {outfit='[B]NOT NEEDED[/B]', text='[B]TEXT ON FLYING UP[/B]', dtext='[B]TEXT ON FLYING DOWN[/B]'}


  • Talkaction - Flyup/flydown

Code:
local s = {
	{100}
}

local water = {4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4664,4665,4666,5757,5756,5755,5759,5760,5758,5761}
function onSay(cid,words,param)
	for _,i in ipairs(s) do
		local r = i[1]
		local v = getThingPos(cid)
		local up,down = {x=v.x,y=v.y,z=v.z-1},{x=v.x,y=v.y,z=v.z+1}
		if words == '/flyup' then
			if getPlayerStorageValue(cid,r) > 0 then
				if getTileItemById(up,460).uid > 0 then
					doPlayerSendTextMessage(cid,20,'[Flying] You have flown up.')
					doSendMagicEffect(up,10)
					doCreatureSay(cid,'Up!',19)
					doTeleportThing(cid,up)
					return doSendMagicEffect(up,10)
				else
					doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly here.')
				end
			else
				doPlayerSendTextMessage(cid,20,'[Flying] You aren\'t mounted.')
			return true
			end
		elseif words == '/flydown' then
			if getPlayerStorageValue(cid,r) > 0 then
				if v.z >= 7 == false then
					if getHouseFromPos(down) == false then
						if(getTileItemById(down,(isInArray(water,itemid)),false).uid) then
							if getTileItemById(v,460).uid > 0 then
								doPlayerSendTextMessage(cid,20,'[Flying] You have flown down.')
								doSendMagicEffect(down,10)
								doCreatureSay(cid,'Down!',19)
								doTeleportThing(cid,down)
								return doSendMagicEffect(down,10)
							else
								doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly into ground.')
							end
						else
							doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly on water.')
						end
					else
						doPlayerSendTextMessage(cid,20,'[Flying] This is a house!')
					end
				else
					doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly into ground.')
				end
			else
				doPlayerSendTextMessage(cid,20,'[Flying] You aren\'t mounted!')
			return true
		end
	end
return true
end
end

Code:
<talkaction words="/flyup;/flydown" event="script" value="[B]SCRIPT_NAME[/B].lua"/>


DON'T CHANGE ANYTHING UNLESS YOU KNOW WHAT YOU'RE DOING.​

+REP IF YOU USE THIS SCRIPT,
All credits to me.

Please comment on use.


_________________

I'm not changing/renewing this script, since it's useless for me, edit it yourselves.

Won't add screenshots, unless someone posts them on this topic, because it's self explenating what it does.
 
Code:
local v, r, s = getCreaturePosition(cid), t[item.itemid], [B]100[/B]

Code:
local s = {
	{[B]100[/B]}
}

Change BOTH the '100' to a custom storageValue, that is not used already.
 
Hmm, I thought C++.

But still,
I don't know how to make it without avoid, or how to make it that a tile gets created + removed on moving.

(Any tip maybe? :))
 
12 comments,
245 views,

Code:
Currently Active Users Viewing This Thread: 5 (5 members and 0 guests)(unknown666, Layon, lucas123, mustanng, neiriwi)

More comments and rep plz? :)
 
sorry i have a problem because I do not know how to begin to fly ...
I write "/ flyup" and I see 21:28 [Flying] You aren't mounted.
 
Script is really good, but if we can do to be able to fly up when the upstairs is not taken with any of the fields in the map editor?
 
I have a problem :'(
When I use the Item, he says to me: 00:06 There has been some error, try contacting a staff member.
Can help me =(?
 
Back
Top Bottom