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

[8.4 TFS] Need script on amulet!

ziomek14b

New Member
Joined
Dec 26, 2007
Messages
98
Reaction score
0
Hi, i need script on amulet.
So when you use it, the amulet teleports you to island.

Thanks.

USING TFS 0.3''
 
When you use it or when you wear it?

Use (Actions):

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x=123, y=112, z=7}
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
	return TRUE
end

Wear (Movements):

PHP:
function onEquip(cid, item, slot)
	local pos = {x=123, y=112, z=7}
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
		return TRUE
end
 
When you use it or when you wear it?

Use (Actions):

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x=123, y=112, z=7}
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
	return TRUE
end

Wear (Movements):

PHP:
function onEquip(cid, item, slot)
	local pos = {x=123, y=112, z=7}
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
		return TRUE
end

If you leave the codes like this youll get 2 magic effects on the same place.

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local pos = {x=123, y=112, z=7}
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
	return TRUE
end

PHP:
function onEquip(cid, item, slot)
    local pos = {x=123, y=112, z=7}
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
		return TRUE
end

The computer is dumb, it doesnt think logically enough to understand that you want to send the effect, teleport and effect again. It reads line by line.
 
If you leave the codes like this youll get 2 magic effects on the same place.

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local pos = {x=123, y=112, z=7}
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
	return TRUE
end

PHP:
function onEquip(cid, item, slot)
    local pos = {x=123, y=112, z=7}
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_GIFT_WRAPS)
	doTeleportThing(cid, pos, TRUE)
	doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
		return TRUE
end

The computer is dumb, it doesnt think logically enough to understand that you want to send the effect, teleport and effect again. It reads line by line.

The computer can't mistake just the human can ;]
 
Back
Top