• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TFS 1.0] Dancer NPC

Jaed Le Raep

★Gaeming★
Joined
Sep 3, 2007
Messages
1,298
Reaction score
446
Hey guys, I'd like to request a script in which a npc would turn random directions at random intervals (though I'd still like the intervals to be configurable), this way it's similar to the way characters "dance" in Tibia. This would be for a dancer NPC, no dialogue is needed as I'll script that in after.
 
Code:
function onThink()
    local config, i, direction, npc = {2000, 1000}, 0, {NORTH, EAST, SOUTH, WEST}, Npc()
    while i <= config[1] do
        addEvent(function () npc:setDirection(direction[math.random(#direction)]) end, i)
        i = i + config[2]
    end
    npcHandler:onThink()
end
 
Last edited:
Back
Top