- Joined
- May 3, 2008
- Messages
- 1,944
- Reaction score
- 166
This script is from 2008, it may not work as intended now. However, I wanted to bring back some basic scripts that can be used as a learning examples.
Status: Not tested / created for 8.1 (reply to this topic if you have tested it!)
Description: If player stands in a certain tile, he can teleport himself after saying the correct password. Could be a great addition for RPG quests.
Author: Mappequ
talkactions/scripts > teleport.lua
talkactions > talkactions.xml
Status: Not tested / created for 8.1 (reply to this topic if you have tested it!)
Description: If player stands in a certain tile, he can teleport himself after saying the correct password. Could be a great addition for RPG quests.
Author: Mappequ
talkactions/scripts > teleport.lua
Code:
local standPos = {x=100,y=100,z=7} -- Tile on which player needs to stand on
local newPos = {x=100,y=100,z=7} -- Tile where player should be teleported after saying password
function onSay(cid, param)
if comparePos(getPlayerPosition(cid), standPos) then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid, newPos)
doSendMagicEffect(newPos, 10)
end
return 1
end
talkactions > talkactions.xml
Code:
<talkaction words="password" script="teleport.lua" /> <!-- The word that needs to be said by player to teleport him from one position to another. -->