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

Solved Party Teleport.

tompan

Member
Joined
Dec 13, 2008
Messages
646
Reaction score
23
Location
Sweden
Hey guys i found this script,
Code:
function onSay(cid, words, param, channel)
local player = getPlayerByNameWildcard(param)
   if(not player) then return true
     end
 
  for _, party in ipairs(getPartyMembers(player)) do
 
    doTeleportThing(party, getCreaturePosition(cid))
     doSendMagicEffect(getCreaturePosition(party), math.random(0, CONST_ME_LAST))
      doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported by "..getCreatureName(cid)..".")
   end
 
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players in the party of "..param.." have been teleported to you.")
    return true
      end
made by Sync.

And i want to change this so it works with onStepIn, i dont get it to work.. so if you can then please help me :)
Also if you want you can add so it just teleport players from Safe Zones or when you attacked a player. or give directions how to. :)

thank you!
 
iam not know much in movements , but i think you need to replace
Lua:
function onSay(cid, words, param, channel)

to
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
and make action id or unique id on movements.xml
example:
XML:
	<movevent type="StepIn" uniqueid="8888" event="script" value="party.lua"/>

and put the uniqueid in the floor which you want when player stepin it do that actions .xd

do that and report back to me if it works :p or not
 
yeah i already tried simlar but not with actor and so, but still nothing hapends.. i have action id and right stuff in the movements.xml :S no errors no nothing works perfekt whith talk action.
 
yeah :S

- - - Updated - - -

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, channel, actor)

local player = getCreatureName(cid)
   if(not player) then return true
     end
 
for _, party in ipairs(getPartyMembers(player)) do      <-------- ERROR IN THIS LINE.
	
    doTeleportThing(party, getCreaturePosition(cid))
     doSendMagicEffect(getCreaturePosition(party), math.random(0, CONST_ME_LAST))
      doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported by "..getCreatureName(cid)..".")
   end
 
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players in the party have been teleported to you.")
    return true
      end
bad agrument #1 to ´ipairs´ <table expected, got boolean>
stack traceback: [C]: in function 'ipairs' data/movements.


if i remove this line it wont get partymembers and then i get error that player thing wasnt found when it will teleport.
 
Last edited:
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, channel, actor)
 
local partylist = getPartyMembers(cid)
   	if not isPlayer or not partylist then 
		return true
   	end
 
	for _, party in ipairs(partylist) do 
    		doTeleportThing(party, getCreaturePosition(cid))
     		doSendMagicEffect(getCreaturePosition(party), math.random(0, CONST_ME_LAST))
      		doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported by "..getCreatureName(cid)..".")
   	end
 
      	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players in the party have been teleported to you.")
    	return true
end
 
Back
Top Bottom