Try this code:
I have not tested this so it might not work!
Woooow calm down. It's not like we snap our fingers and the code just magically appears.
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.