no longer need help resolved issue
no longer need help resolved issue
Last edited by Confucius; 07-23-2009 at 08:33 PM.
player:RemoveItem(ITEMID, 1) will remove the item on use.
About the spawning.. doesn't it get saved when you just use SpawnGameObject?
If not, you'll have to execute a query (which requires a special Lua engine).
I'm using aspire's database here though, so I'm not sure how much ArcEmu's differs.
Code:Execute(1, "INSERT INTO gameobject_spawns (`ID`,`Entry`,`Map`,`position_x`,`position_y`,`position_z`,`Facing`,`orientation1`,`orientation2`,`orientation3`,`orientation4`,`State`,`Flags`,`Faction`,`Scale`,`phase`) VALUES ('0','GAMEOBJECTIDHERE','"..player:GetMapID().."','"..player:GetX().."','"..player:GetY().."','"..player:GetZ().."','"..player:GetO().."','0','0','0','0','1','0','0','1','1');")
Last edited by Dynashock; 07-23-2009 at 05:37 PM.
I'm using aspire too hehe thanks for that command +Rep what lua engine can do that?
ahh I'm on cooldown I'll give you your Rep later
GuaEngine can do that. If you're not using it yet and you're using Lua I'd recommend getting it anyway.
I have Gua engine! is that thing u posted above the command
The thing in the codebox is indeed the command for spawning the gameobject right on top of the player. It executes a query into the gameobject_spawns table directly.
In case you're wondering, it doesn't need a prefix (prefix is the thing before the command usually, like player:GetX()) as it's a core function.
I loves u ty!!! +Rep when I can!!! this will be epic housing system
there was error I will post and script
script
Code:function standardhouse_Trigger(item, event, player, id, intid, code) x = player:GetX() y = player:GetY() z = player:GetZ() o = player:GetO() z = z - 3 player:SpawnGameObject(2,x,y,z,o,0) Execute(1, "INSERT INTO gameobject_spawns (`ID`,`Entry`,`Map`,`position_x`,`position_y`,`position_z`,`Facing`,`orientation1`,`orientation2`,`orientation3`,`orientation4`,`State`,`Flags`,`Faction`,`Scale`,`phase`) VALUES ('0','2','"..player:GetMapID().."','"..player:GetX().."','"..player:GetY().."','"..player:GetZ().."','"..player:GetO().."','0','0','0','0','1','0','0','1','1');") player:RemoveItem(2, 1) end RegisterItemGossipEvent(2,1,"standardhouse_Trigger") RegisterItemGossipEvent(2,2,"OnSelect")
Last edited by Confucius; 07-23-2009 at 05:50 PM.
Not to be mean but this would be much better done in C++. You could take advantage of phasing, among other things.
I know no C++ though D:
As far as I know 'attempt to call method 'something' (a nil value)' means the function doesn't exist/work. It could be that the syntax is slightly different so try player:GetMapId() instead. (The d being upper-case could have caused it as Lua is case-sensitive. So make sure the d is lower-case now.)
same error, could I just set the map ID if players are only gonna spawn in certain places?
Yeah, should be possible too. Command will then be:
Code:Execute(1, "INSERT INTO gameobject_spawns (`ID`,`Entry`,`Map`,`position_x`,`position_y`,`position_z`,`Facing`,`orientation1`,`orientation2`,`orientation3`,`orientation4`,`State`,`Flags`,`Faction`,`Scale`,`phase`) VALUES ('0','2','MAPIDHERE','"..player:GetX().."','"..player:GetY().."','"..player:GetZ().."','"..player:GetO().."','0','0','0','0','1','0','0','1','1');")
hehe ty .
error about attempt to call global execute