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

How to add a textwindow into script?

manggo

New Member
Joined
Apr 6, 2021
Messages
7
Reaction score
0
GitHub
Bambik
Hi,
I have a script on follow player.
However, I cant add a textwindow so that it would be easier/faster to enter the nickname of the player (no need to search for script to enter a name)
Is anyone able to help me?


Lua:
local toFollow = "playername"
local toFollowPos = {}

local followMacro = macro(20, "follow target", function()
  local target = getCreatureByName(toFollow)
  if target then
    local tpos = target:getPosition()
    toFollowPos[tpos.z] = tpos
  end
  if player:isWalking() then return end
  local p = toFollowPos[posz()]
  if not p then return end
  if autoWalk(p, 20, {ignoreNonPathable=true, precision=1}) then
    delay(100)
  end
end)
 
Lua:
local toFollowPos = {}

local followMacro = macro(20, "follow target", function()
  local target = getCreatureByName(storage.toFollow)
  if target then
    local tpos = target:getPosition()
    toFollowPos[tpos.z] = tpos
  end
  if player:isWalking() then return end
  local p = toFollowPos[posz()]
  if not p then return end
  if autoWalk(p, 20, {ignoreNonPathable=true, precision=1}) then
    delay(100)
  end
end)

addTextEdit("Namefollowplayer", storage.toFollow or "name", function(widget, text)
storage.toFollow = text
end)
 
Back
Top