Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
tfs 1.2 so i need script if player is on specific tile you cant push him if hes on that tile (it would be good if you could go trough him too if its possible)
tfs 1.2 so i need script if player is on specific tile you cant push him if hes on that tile (it would be good if you could go trough him too if its possible)
Hi,
This code will block Player be pushed when above the tile ID 106 and 405.
In data/events/scripts/player.lua look for Player:onMoveCreature function and above the last return true in the function scope put:
Lua:
local blockedIds = {106, 405} --106 = grass id, 405 = wooden floor id
if table.contains(blockedIds, fromPosition:getTile():getId()) then
return false
end
Lua:
function Player:onMoveCreature(creature, fromPosition, toPosition)
local blockedIds = {106, 405} --106 = grass id, 405 = wooden floor id
if table.contains(blockedIds...
tfs 1.2 so i need script if player is on specific tile you cant push him if hes on that tile (it would be good if you could go trough him too if its possible)
Hi,
This code will block Player be pushed when above the tile ID 106 and 405.
In data/events/scripts/player.lua look for Player:onMoveCreature function and above the last return true in the function scope put:
Lua:
local blockedIds = {106, 405} --106 = grass id, 405 = wooden floor id
if table.contains(blockedIds, fromPosition:getTile():getId()) then
return false
end
Lua:
function Player:onMoveCreature(creature, fromPosition, toPosition)
local blockedIds = {106, 405} --106 = grass id, 405 = wooden floor id
if table.contains(blockedIds, fromPosition:getTile():getId()) then
return false
end
return true
end
Now go to data/events/events.xml and look for <event class="Player" method="onMoveCreature" enabled="1"/> and be sure that enabled value is 1.
Hi,
This code will block Player be pushed when above the tile ID 106 and 405.
In data/events/scripts/player.lua look for Player:onMoveCreature function and above the last return true in the function scope put:
Lua:
local blockedIds = {106, 405} --106 = grass id, 405 = wooden floor id
if table.contains(blockedIds, fromPosition:getTile():getId()) then
return false
end
Lua:
function Player:onMoveCreature(creature, fromPosition, toPosition)
local blockedIds = {106, 405} --106 = grass id, 405 = wooden floor id
if table.contains(blockedIds, fromPosition:getTile():getId()) then
return false
end
return true
end
Now go to data/events/events.xml and look for <event class="Player" method="onMoveCreature" enabled="1"/> and be sure that enabled value is 1.