• 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 Can't see movevent

survivor

New Member
Joined
Mar 20, 2008
Messages
89
Reaction score
4
I am using TFS 1.0 and my tiles aren't working. They did however work on 0.2. I do not get an error message at all it is like it doesn't even see the script..

movements.xml:
Code:
  <movevent event="StepIn" actionid="825" script="premium/premium tile uk.lua"/>

premium/premium tile uk.lua:
Code:
function onStepIn(cid, item, position, fromPosition)

  if item.actionid == 825 then
  if isPlayer(cid) then
  if isPremium(cid) == false then
doTeleportThing(cid, {x=1425, y=989, z=10}, true)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doCreatureSay(cid, "Sorry, only Premium players are allowed to pass!", TALKTYPE_MONSTER)
doPlayerSendTextMessage(cid, 27, "Premium members only!")
  else
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
doPlayerSendTextMessage(cid, 27, "You have entered a premium area.")
doCreatureSay(cid, "Welcome, Premium member!", TALKTYPE_MONSTER)
  end
  end
  end
return true
end
 
I am using TFS 1.0 and my tiles aren't working. They did however work on 0.2. I do not get an error message at all it is like it doesn't even see the script..

movements.xml:
Code:
  <movevent event="StepIn" actionid="825" script="premium/premium tile uk.lua"/>

premium/premium tile uk.lua:
Code:
function onStepIn(cid, item, position, fromPosition)

  if item.actionid == 825 then
  if isPlayer(cid) then
  if isPremium(cid) == false then
doTeleportThing(cid, {x=1425, y=989, z=10}, true)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doCreatureSay(cid, "Sorry, only Premium players are allowed to pass!", TALKTYPE_MONSTER)
doPlayerSendTextMessage(cid, 27, "Premium members only!")
  else
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
doPlayerSendTextMessage(cid, 27, "You have entered a premium area.")
doCreatureSay(cid, "Welcome, Premium member!", TALKTYPE_MONSTER)
  end
  end
  end
return true
end
I'm not familiar with 1.0 scripting, however I can clearly see that this is not written in the way that 1.0 scripts are scripted.
You will need to convert the script from 0.2 to 1.0 using the correct methods that 1.0 require.
for example.. removing an item..
Code:
doRemoveItem(2344,1) -- 0.3.7
player:removeItem(2344, 1) -- 1.0
 
Code:
function onStepIn(cid, item, position, fromPosition)
    local player = Player(cid)
    if not player then
        return true
    end

    if player:getPremiumDays() == 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Premium members only!")
        player:say("Sorry, only Premium players are allowed to pass!", TALKTYPE_MONSTER_SAY)
        player:teleportTo(fromPosition, true)
        fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_RED)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have entered a premium area.")
    player:say("Welcome, Premium member!", TALKTYPE_MONSTER_SAY)
    return true
end
 
Back
Top