spawnmob
#4
What I did wrong? Huh
function HandleSpawnMobCommand ( Player, Split, World, OtherPlayer )
    if Split[2] == nil then
        Player:SendMessage( "Usage: /spawnmob <mobtype> <player>" )
        return true
    end
    if Split[2] == creeper and Split[3] == nil then
        Player:GetWorld():SpawnMob( Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), 50 )
        Player:SendMessage( "Creeper spawned!" )
        return true
    end
    if Split[2] == creeper and Split[3] == OtherPlayer then
        OtherPlayer:GetWorld():SpawnMob( OtherPlayer:GetPosX(), OtherPlayer:GetPosY(), OtherPlayer:GetPosZ(), 50 )
        Player:SendMessage( "Creeper spawned!" )
        return true
    end
end
It gives me errors:
[20:01:28] LUA: Plugins/SpawnMob/main.lua:12: attempt to call method 'SendMessage' (a nil value)
[20:01:28] LUA error in cPlugin_NewLua::HandleCommand. Stack size: 3
and
[20:01:28] LUA: Plugins/SpawnMob/main.lua:12: attempt to call method 'GetWorld' (a nil value)
[20:01:28] LUA error in cPlugin_NewLua::HandleCommand. Stack size: 3
Reply
Thanks given by:


Messages In This Thread
spawnmob - by NiLSPACE - 12-25-2011, 09:28 PM
RE: spawnmob - by NiLSPACE - 02-16-2012, 03:16 AM
RE: spawnmob - by tonibm19 - 07-12-2013, 12:15 AM
RE: spawnmob - by tonibm19 - 07-12-2013, 04:02 AM
RE: spawnmob - by NiLSPACE - 07-12-2013, 04:10 AM
RE: spawnmob - by tonibm19 - 07-12-2013, 04:12 AM
RE: spawnmob - by xoft - 07-12-2013, 04:21 AM
RE: spawnmob - by NiLSPACE - 07-12-2013, 04:22 AM
RE: spawnmob - by xoft - 07-12-2013, 04:27 AM
RE: spawnmob - by NiLSPACE - 07-12-2013, 05:01 AM
RE: spawnmob - by xoft - 07-12-2013, 04:20 PM
RE: spawnmob - by NiLSPACE - 07-12-2013, 05:16 PM
RE: spawnmob - by xoft - 07-13-2013, 06:29 AM



Users browsing this thread: 1 Guest(s)