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

What is wrong?

Ecstacy

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

I'm having some problems with this script that I can't figure out :s.

The problem is that when i'm in the outfit 'rat', it doesn't work, but when I'm in the outfit 'mew', It works 100%.

Code:
local s = {
	{name = 'mew', st = 100},
	{name = 'rat', st = 101}
}
function onSay(cid, words, param, channel)
	local v = getCreaturePosition(cid)
	local up, down = {x = v.x, y = v.y, z = v.z-1}, {x = v.x, y = v.y, z = v.z+1}
	local r = s[1]
	if words == '/flyup' then
		if getPlayerStorageValue(cid, r.st) == 1 then
			if getTileItemById(up, 460).uid > 0 then
				doTeleportThing(cid, up, true)
				doSendMagicEffect(up, 10)
				doCreatureSay(cid, 'Up!', 19)
				return doPlayerSendTextMessage(cid, 20, 'You have flown up.')
			else
				return doPlayerSendTextMessage(cid, 20, 'You can\'t fly up here.')
			end
		else
			return doPlayerSendTextMessage(cid, 20, 'You aren\'t mounted.')
		end
		return true
	end
	if words == '/flydown' then	
		if getPlayerStorageValue(cid, r.st) == 1 then
			if getTileItemById(down, 460).uid > 0 then
				doTeleportThing(cid, down, true)
				doSendMagicEffect(down, 10)
				doCreatureSay(cid, 'Down!', 19)
				doPlayerSendTextMessage(cid, 20, 'You have flown down.')
			elseif v.z == 6 then
				if getTileItemById(v,460).uid > 0 then
					if doTeleportThing(cid, down, true) then
						doSendMagicEffect(down, 10)
						doCreatureSay(cid, 'Down!', 19)
						doPlayerSendTextMessage(cid, 20, 'You have flown down.')
					else
						return doPlayerSendTextMessage(cid, 20, 'You can\'t fly down here.')
					end
				else
					return doPlayerSendTextMessage(cid, 20, 'You can\'t fly down here')
				end
			else
				return doPlayerSendTextMessage(cid, 20, 'You can\'t fly down here.')
			end
		else
			return doPlayerSendTextMessage(cid, 20, 'You aren\'t mounted.')
		end
		return true
	end
end
 
Back
Top