Please Create a Plugin For SpawnAnimal
#1
help please Huh
Reply
Thanks given by:
#2
Please be more precise.
Reply
Thanks given by:
#3
spawn a creeper
a cow
a entity
........
Reply
Thanks given by:
#4
Commands? Parameters? Config?
Reply
Thanks given by:
#5
I don't know
maybye a copy of
essential plugin ? this command is /spawnmob

help ?????
Reply
Thanks given by:
#6
Try this code:
PLUGIN = nil

function Initialize(Plugin)
	PLUGIN = Plugin
	Plugin:SetName("SpawnMob")
	Plugin:SetVersion(1)
	
	local PluginManager = cPluginManager:Get()
	PluginManager:BindCommand("/spawnmob", "spawnmob.spawnmob", HandleSpawnMobCommand, " ~ [MobType] Spawns a mob at the place you\'re looking at.")
	
	return true
end

function HandleSpawnMobCommand(Split, Player)
	if Split[2] == nil then
		Player:SendMessage(cChatColor.Rose .. "Usage: /spawnmob [Mob]")
		return true
	end
	
	local MobType = StringToMobType(Split[2])
	if MobType == cMonster.mtInvalidType then
		Player:SendMessage(cChatColor.Rose .. "Invalid mob type.")
		return true
	end
	
	local BlockX, BlockY, BlockZ
	local World = Player:GetWorld()
	
	local Callbacks = {
	OnNextBlock = function(X, Y, Z, BlockType, BlockMeta)
		if BlockType ~= E_BLOCK_AIR then
			BlockX, BlockY, BlockZ = X, Y, Z
			return true
		end
	end
	};
	
	local EyePos = Player:GetEyePosition()
	local LookVector = Player:GetLookVector()
	LookVector:Normalize()
	local Start = EyePos
	local End = EyePos + LookVector * 150

	cLineBlockTracer.Trace(World, Callbacks, Start.x, Start.y, Start.z, End.x, End.y, End.z)
	
	World:SpawnMob(BlockX, BlockY, BlockZ, MobType
	Player:SendMessage(cChatColor.LightGreen .. "A " .. Split[2] .. " was spawned at " .. BlockX .. " " .. BlockY .. " " .. BlockZ)
	return true
end

I have not tested this so it might not work!


(02-20-2014, 05:25 AM)louisgg Wrote: help ?????

Woooow calm down. It's not like we snap our fingers and the code just magically appears.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)