spawnmob
#8
I don't see anywhere what OtherPlayer is. Its just a nil value I think. I usely use something like this: I quickly created it so there could be some mistakes in it.
function ReturnMobIDFromString(Mob)
	if Mob == nil then
		return;
	end
	Mob = string.upper(Mob)
	elseif Mob == "CREEPER" then
		return 50
	elseif Mob == "SKELETON" then
		return 52
	elseif Mob == "SPIDER" then
		return 52
	elseif Mob == "GIANT" then
		return 53
	elseif Mob == "ZOMBIE" then
		return 52
	-- ETC.
	end
end

Mob = ReturnMobIDFromString(Split[2])
if Mob == nil then
	Player:SendMessage("Mob not found")
	return true
end
if Split[3] ~= nil then
	cRoot:Get():ForEachPlayer(
	function(OtherPlayer)
	if OtherPlayer:GetName() == Split[3] then
		OtherPlayer:GetWorld():SpawnMob(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), Mob)
	end)
	return true
end
Player:GetWorld():SpawnMob(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), Mob)
Reply
Thanks given by: tonibm19


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: 7 Guest(s)