megachock
Member
- Joined
- Mar 12, 2009
- Messages
- 115
- Reaction score
- 7
Hey guys im learning scripting, this is my second script is very simple but usefull.
In movements/movements.xml
39812 is the action id of the teleport in the map.
In movements/scripts/
Copy any script and rename it PremiumTeleport.lua
and paste it inside:
Thanks to acubens for the cancel.
local pos = position where player will be teleported
local txt = txt player will see when gets teleported
loca fail = text if the player cant be teleported
In movements/movements.xml
Code:
<movevent type="StepIn" actionid="39812" event="script" value="PremiumTeleport.lua"/>
39812 is the action id of the teleport in the map.
In movements/scripts/
Copy any script and rename it PremiumTeleport.lua
and paste it inside:
Thanks to acubens for the cancel.
Lua:
function onStepIn(cid, fromPosition)
local pos = {x=1000, y=1000, z=7}
local txt = "You have been teleported."
local fail = "You are not premium."
if isPlayer(cid) and isPremium(cid) then
doTeleportThing(cid, pos)
doSendMagicEffect(pos, 12)
doPlayerSendTextMessage(cid, 22, txt)
else
doPlayerSendTextMessage(cid, 22, fail)
doTeleportThing(cid, fromPosition)
end
return TRUE
end
local pos = position where player will be teleported
local txt = txt player will see when gets teleported
loca fail = text if the player cant be teleported
Last edited: