• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Request] Play a Music to enter

Nux

Yzeria Custom War
Joined
Jan 2, 2009
Messages
1,067
Reaction score
1
Well i got an idea for my war server and tought to put it in here and see if someone could make it for me.. well check the pic out and it would give you a humm of it.. you can always pm me and ask me more about the idea


namnlsl.jpg


Nux~
 
This is possible, quite easy actually.
I would like to help, but I am not at home...at school, in a class.
(I like to test stuff before releasing)
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local config = {
		reqPos = {x=,y=,z=}, -- Position, on which player has to stand while music is playing.
		inside = {x=,y=,z=}, -- Position where player will be teleported.
		msg = "Password match. :P"
	}

	if (getCreaturePosition(cid) == config.reqPos) then
		doTeleportThing(cid, config.inside)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
	end

	return TRUE
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local config = {
		reqPos = {x=,y=,z=}, -- Position, on which player has to stand while music is playing.
		inside = {x=,y=,z=}, -- Position where player will be teleported.
		msg = "Password match. :P"
	}

	if (getCreaturePosition(cid) == config.reqPos) then
		doTeleportThing(cid, config.inside)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
	end

	return TRUE
end
Where does this check if the player is playing music or not?^_^
 
OMG really good idea (: i will create it ;D

Try it (:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local config = {
		reqPos = {x=,y=,z=}, -- Position, on which player has to stand while music is playing.
		inside = {x=,y=,z=}, -- Position where player will be teleported.
		msg = "Bad Music!"
	}
	local storage = getPlayerStorageValue(cid, 2073)

	if (getCreaturePosition(cid) == config.reqPos) then
		if item.itemid == 2073 then
			if storage == -1 then
				setPlayerStorageValue(cid, 2073, 1)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "DO...")
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
				setPlayerStorageValue(cid, 2073, -1)
			end
		elseif item.itemid == 2070 then
			if storage == 1 then
				setPlayerStorageValue(cid, 2073, 2)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "RE...")
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
				setPlayerStorageValue(cid, 2073, -1)
			end
		elseif item.itemid == 2079 then
			if storage == 2 then
				setPlayerStorageValue(cid, 2073, -1)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "MI...")
				doTeleportThing(cid, config.inside)
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
				setPlayerStorageValue(cid, 2073, -1)
			end
		end
	end
	return TRUE
end
Here we got a working one.
 
OMG really good idea (: i will create it ;D

Try it (:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local config = {
		reqPos = {x=,y=,z=}, -- Position, on which player has to stand while music is playing.
		inside = {x=,y=,z=}, -- Position where player will be teleported.
		msg = "Bad Music!"
	}
	local storage = getPlayerStorageValue(cid, 2073)

	if (getCreaturePosition(cid) == config.reqPos) then
		if item.itemid == 2073 then
			if storage == -1 then
				setPlayerStorageValue(cid, 2073, 1)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "DO...")
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
				setPlayerStorageValue(cid, 2073, -1)
			end
		elseif item.itemid == 2070 then
			if storage == 1 then
				setPlayerStorageValue(cid, 2073, 2)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "RE...")
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
				setPlayerStorageValue(cid, 2073, -1)
			end
		elseif item.itemid == 2079 then
			if storage == 2 then
				setPlayerStorageValue(cid, 2073, -1)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "MI...")
				doTeleportThing(cid, config.inside)
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.msg)
				setPlayerStorageValue(cid, 2073, -1)
			end
		end
	end
	return TRUE
end

Well tnx that you think its a good idea.. well im kinda noob with this stuff and im wondering how to put that script so it would work? where should i put that script etc..
 
data/actions/scripts
and actions.xml you need to make an event.

PHP:
<action itemid="xxxx" script="music_tp.lua"/>
 
Well i puted the script on actions and it didnt work.. cuz when i walked on the spot i pushed me down a ground.. and when i tryed movements it gave me an energy hit.. i mean that i damaged me with energy.. and i died..
 
Back
Top