<movevent event="StepIn" itemid="" actionid="1000" script="tilescript.lua" />
function onStepIn(creature, item, position, fromPosition)
if item.actionid == 1000 then
doBroadcastMessage("msg..") -- your broadcast function here
end
return true
end
/\ forgot a end before return true
Please post tfs version.
doBroadcastMessage("msg ".. getPlayerName(cid) .. " here!")
try this:
Code:doBroadcastMessage("msg ".. getPlayerName(cid) .. " here!")
btw this is a list of functions that may help you in future
https://otland.net/threads/lua-functions-list.14039/
- [Error - MoveEvents Interface]
- data/movements/scripts/godly axe.lua: onStepIn
- Description:
- (luaGetCreatureName) Creature not found
- [Error - MoveEvents Interface]
- data/movements/scripts/godly axe.lua: onStepIn
- Description:
- data/movements/scripts/godly axe.lua:3: attempt to concatenate a boolean value
- stack traceback:
- data/movements/scripts/godly axe.lua:3: in function <data/movements/scripts/godly axe.lua:1>
yeah try this instead getCreatureName(cid), you might not have getPlayerName functioni got this error
Try thisIt doesnt work
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)
if item.actionid == 1000 then
if isPlayer(cid) then -- Check to avoid sending this message if a monster/NPC stepped on this tile
doBroadcastMessage("Player named " .. getCreatureName(cid) .. " stepped onto the special tile.")
end
end
return true
end
yeah try this instead getCreatureName(cid), you might not have getPlayerName function
Problem is that the userdata was passed to the function under the variable name "creature" but it's being used as "cid" in getCreatureName.
My problem is solved.
Thanks you all.