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

Solved TFS 1.0 Game.createTile

Karain

Jack of all trades
Joined
Jul 9, 2009
Messages
338
Solutions
3
Reaction score
147
Location
Egypt
Hello, i'd like to create ground and items on empty map in TFS 1.0, After some searching around the forums, i found that my answer should lie in Game.createTile(position).

i did try it but it doesn't seem to work :(

Here's my piece of code

Code:
local ground = 9043
local newgroundpos = {100,100,7}

if Game.createTile(newgroundpos) then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "creating a tile")
                end
                Game.createItem(ground, 1,newgroundpos)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "creating a ground id "..ground)

I do get the "creating a tile" message, the code works, but not as i imagine it should do, so am i using the code wrong or is the function not meant to do what i want in the first place?

Thanks in advance.

Anyone? XD
 
Last edited by a moderator:
What do you expect it to do?

Check whether there is an existing tile or not before you use Game.createTile, and ground for Game.createItem.
 
What do you expect it to do?

Check whether there is an existing tile or not before you use Game.createTile, and ground for Game.createItem.

i added value to the variables just for clarification.

Newgroundpos = {100, 100, 7} is an empty spot on the map, there is no tile there. i want my code to build grass id 9043 on it.

i thought Game.createTile would make the tile buildable...
 
~Status Update:

It works!!

By using
Code:
local newpos = Position(x,y,z,stackpos)
local newtile = Game.createTile(newpos)
and then create items into the position by calling the x,y,z of newtile like so

Code:
Game.createItem(4529, 1, {x=newtile:getPosition().x, y=newtile:getPosition().y, z=newtile:getPosition().z})

Case is solved my good sir, i can't thank you enough Ninja <3
 
Back
Top