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

movement based on player name

Jfrye

Mapper, trying to learn scripting
Joined
Jan 8, 2009
Messages
365
Solutions
5
Reaction score
86
Location
Mexico Missouri
Hey guys, Im using TFS 1.1, client version 10.77.

Basically Im looking for a script that allows 'player x' on a tile. 'player x' is the character name, and if the character name is NOT 'player x' then make them stepback and send a message, such as 'nice try' or 'you are not the owner of this throne'. (you get the idea)

Basically I have a friend on my OT project that likes to mess around a bit. So I put a throne in a room, and have an animated text script above the throne with my characters name on it. When he sees my name flashing above the chair he will jump on the chair, but in return I want to mess with him on this one.

Is this even possible to make a movement script based off of a player name?
 
Solution
This is for TFS 0.3.7
If anyone wants to convert the couple of function, by all means.

Just put an actionID, on the tiles you want to use this on. (Not the chair, the tile under)
Lua:
local messages = {"Sorry! hehe", "Better luck next time!", "Why you running away, bro?"}
function onStepIn(cid, item, position, fromPosition)
   if getCreatureName(cid):lower() == "xikini" then
       return true
   end
   doTeleportThing(cid, fromPosition, true)
   doCreatureSay(cid, messages[math.random(#messages)], TALKTYPE_ORANGE_1, false)
   return true
end
Yes it is. Get creature name, compare it with yours defined, when it is false then push back.
 
This is for TFS 0.3.7
If anyone wants to convert the couple of function, by all means.

Just put an actionID, on the tiles you want to use this on. (Not the chair, the tile under)
Lua:
local messages = {"Sorry! hehe", "Better luck next time!", "Why you running away, bro?"}
function onStepIn(cid, item, position, fromPosition)
   if getCreatureName(cid):lower() == "xikini" then
       return true
   end
   doTeleportThing(cid, fromPosition, true)
   doCreatureSay(cid, messages[math.random(#messages)], TALKTYPE_ORANGE_1, false)
   return true
end
 
Last edited:
Solution
This is for TFS 0.3.7
If anyone wants to convert the couple of function, by all means.

Just put an actionID, on the tiles you want to use this on. (Not the chair, the tile under)
Lua:
local messages = {"Sorry! hehe", "Better luck next time!", "Why you running away, bro?"}
function onStepIn(cid, item, position, fromPosition)
   if getCreatureName(cid):lower() == "xikini" then
       return true
   end
   doTeleportThing(cid, fromPosition, true)
   doCreatureSay(cid, messages[math.random(#messages)], TALKTYPE_ORANGE_1, false)
   return true
end

This works perfectly on TFS 1.1 No errors, and it works just as it should. Thank you for this.
 
Back
Top