stefutz101 Posted August 24, 2015 Share Posted August 24, 2015 WARNING: [DayZ-MTA]/DayZ/survivorSystem.lua_dayz:438: Bad argument @ [ 'destroyElement' [Expected element at argument 1, got boolean] [ [22:51:08] WARNING: [DayZ-MTA]/DayZ/survivorSystem.lua_dayz:343: Bad argument @ [ 'setPedSkin' [Expected element at argument 1, got number '285'] 343: setPedSkin(getElementData(source,"skin")) 438 destroyElement(elementWeaponBack[source]) For line 343 i can use this ? setPedSkin(source,getElementData(source,"skin")) Help please :3 ! Link to comment
t3wz Posted August 24, 2015 Share Posted August 24, 2015 For the first error elementWeaponBack[source] is returning a boolean and not an element, check where you define/set elementWeaponBack to find the problem, for the second you have to use setElementModel (setPedSkin is deprecated as cited in the wiki) also the first parameter of this function is an element and not a number (check the wiki). Link to comment
stefutz101 Posted August 25, 2015 Author Share Posted August 25, 2015 Ty , fixed How i can repair that ? First 3 warnings function findPath (ped) local allwaypoints = getElementsByType ( "pathpoint" ) if #allwaypoints > 2 then if (isElement(getElementData(ped,"controller"))) then triggerClientEvent ( "pedPathfind", getElementData(ped,"controller"), ped) end else setElementData ( ped, "target", nil ) setElementData ( ped, "leader", nil ) assigncontroller(ped) setElementData ( ped, "status", "waiting" ) end end --ped picks the path node to start with addEvent( "pedPathChoose", true ) last 2 warnings local slothbot = createPed (tonumber(skin),tonumber(x),tonumber(y),tonumber(z))--spawns the ped if (slothbot ~= false) then triggerEvent ( "onBotSpawned", slothbot ) setTimer ( setElementData, 200, 1, slothbot, "slothbot", true ) -- makes it a bot setTimer ( setElementData, 200, 1, slothbot, "AllowFire", true ) -- makes it able to shoot when it wants setTimer ( assigncontroller, 300, 1, slothbot ) --sets the bots controller setTimer ( giveWeapon, 800, 1, slothbot, tonumber(weapon), 99999, true ) --gives the weapon------------------------------------------------------------------------------------------ setElementData(slothbot, "BotWeapon", tonumber(weapon)) if team ~= nil then setElementData(slothbot, "BotTeam", team) end setTimer ( setElementInterior, 100, 1, slothbot, tonumber(interior)) --sets interior setTimer ( setElementDimension, 100, 1, slothbot, tonumber(dimension)) --sets dimension http://iceimg.net/images/2015/08/25/mta ... -58-33.png Please help , or is someone what know a fixed slothbot ? With not many errors ? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now