Hetcolt
02-25-2016, 12:35 AM
hello,
I got this script from friend. Usually it is used to tame creatures. But I want to use it to convince creatures for example Dreadbeast. But it doesn work :( can you help me pls?
function useItem(monster, itemID, backpack)
local Backpack = Container.GetByName(backpack)
local Monster = Creature.GetByName(monster)
if (Monster:isValid()) then
if (Monster:isOnScreen() and Monster:isVisible() and Monster:isAlive()) then
for Spot = 0, Backpack:ItemCount() do
local item = Backpack:GetItemData(Spot)
if item.id == itemID then
Backpack:UseItemWithCreature(spot, Monster:ID())
alert()
setWalkerEnabled(false)
setTargetingEnabled(false)
end
end
end
end
end
while (true) do
local Monster = "Dreadbeast"
local ItemToUse = 3177
local Backpack = "Beach Backpack"
useItem(Monster, ItemToUse, Backpack)
wait(900, 1600)
end
I got this script from friend. Usually it is used to tame creatures. But I want to use it to convince creatures for example Dreadbeast. But it doesn work :( can you help me pls?
function useItem(monster, itemID, backpack)
local Backpack = Container.GetByName(backpack)
local Monster = Creature.GetByName(monster)
if (Monster:isValid()) then
if (Monster:isOnScreen() and Monster:isVisible() and Monster:isAlive()) then
for Spot = 0, Backpack:ItemCount() do
local item = Backpack:GetItemData(Spot)
if item.id == itemID then
Backpack:UseItemWithCreature(spot, Monster:ID())
alert()
setWalkerEnabled(false)
setTargetingEnabled(false)
end
end
end
end
end
while (true) do
local Monster = "Dreadbeast"
local ItemToUse = 3177
local Backpack = "Beach Backpack"
useItem(Monster, ItemToUse, Backpack)
wait(900, 1600)
end