LiOneLMeSsIShoT Posted November 24, 2013 Posted November 24, 2013 can you guys help me with this simple script error? server: function gta (thePlayer) Guard = createPed (240,x,y,z) local x,y,z = getElementPosition (thePlayer) exports.slothbot:setBotFollow (Guard, thePlayer) end addCommandHandler ("guard", gta) Bad argument @ 'createPed' and Thanks.
TAPL Posted November 24, 2013 Posted November 24, 2013 function gta (thePlayer) local x,y,z = getElementPosition (thePlayer) Guard = createPed (240,x,y,z) exports.slothbot:setBotFollow (Guard, thePlayer) end addCommandHandler ("guard", gta)
LiOneLMeSsIShoT Posted November 24, 2013 Author Posted November 24, 2013 function gta (thePlayer) local x,y,z = getElementPosition (thePlayer) Guard = createPed (240,x,y,z) exports.slothbot:setBotFollow (Guard, thePlayer) end addCommandHandler ("guard", gta) Yeah works but why the ped don't follow the player ! the ped don't follow me
TAPL Posted November 24, 2013 Posted November 24, 2013 That's because you used createPed but you need to use spawnBot. https://wiki.multitheftauto.com/wiki/Slothman/Slothbot
LiOneLMeSsIShoT Posted November 24, 2013 Author Posted November 24, 2013 That's because you used createPed but you need to use spawnBot.https://wiki.multitheftauto.com/wiki/Slothman/Slothbot Alright if i do it...not works...tried already so ? function gta (thePlayer) local x,y,z = getElementPosition (thePlayer) Guard = exports.slothbot:spawnBot (240,x,y,z) exports.slothbot:setBotFollow (Guard, thePlayer) end addCommandHandler ("guard", gta)
TAPL Posted November 24, 2013 Posted November 24, 2013 Please read the arguments carefully. https://wiki.multitheftauto.com/wiki/Slothman/Slothbot#spawnBot
LiOneLMeSsIShoT Posted November 24, 2013 Author Posted November 24, 2013 Please read the arguments carefully.https://wiki.multitheftauto.com/wiki/Slothman/Slothbot#spawnBot Alright fixed it but why the ped attacks me ?
LiOneLMeSsIShoT Posted November 24, 2013 Author Posted November 24, 2013 Please read the arguments carefully.https://wiki.multitheftauto.com/wiki/Slothman/Slothbot#spawnBot Alright fixed it but why the ped attacks me ? and then i have Falsed the attack..but still attacks me function gta (thePlayer) local x,y,z = getElementPosition (thePlayer) Guard = exports.slothbot:spawnBot (x,y,z,0, 240) exports.slothbot:setBotFollow (Guard, thePlayer) exports.slothbot:setBotAttackEnabled (Guard, false) end addCommandHandler ("guard", gta)
LiOneLMeSsIShoT Posted November 24, 2013 Author Posted November 24, 2013 Alright i've edit the script to this but the ped still ATTACKS ME after spawns it! function gta (thePlayer) local x,y,z = getElementPosition (thePlayer) Guard = exports.slothbot:spawnBot (x,y,z,0, 240, 0, 0, nil, 0, "follow", nil) end addCommandHandler ("guard", gta)
LiOneLMeSsIShoT Posted November 24, 2013 Author Posted November 24, 2013 Alright i've edit the script to this but the ped still ATTACKS ME after spawns it! function gta (thePlayer) local x,y,z = getElementPosition (thePlayer) Guard = exports.slothbot:spawnBot (x,y,z,0, 240, 0, 0, nil, 0, "follow", nil) end addCommandHandler ("guard", gta) Then Changed this Shit script again to this function gta (thePlayer) local x,y,z = getElementPosition (thePlayer) Guard = exports.slothbot:spawnBot (x,y,z,0, 240, 0, 0, nil, 0, "follow", nil) if getAccountName(getPlayerAccount(thePlayer)) == "LiOneLMeSsI" and exports.slothbot:getBotAttackEnabled (Guard) then exports.slothbot:setBotAttackEnabled (Guard, false) end end addCommandHandler ("guard", gta) Still Attacks me!!!!...how i can to stop him from attacking people.
TAPL Posted November 24, 2013 Posted November 24, 2013 Aggressiveness: Bots will attack any ped, player or bot thats not on it's team.
LiOneLMeSsIShoT Posted November 25, 2013 Author Posted November 25, 2013 4x posts? WTF read what TAPL posted. if you have a problem in this post..then don't reply please. THanks.
LiOneLMeSsIShoT Posted November 25, 2013 Author Posted November 25, 2013 Aggressiveness: Bots will attack any ped, player or bot thats not on it's team. Alright but i set him to not attack anyone in setBotAttackEnabled (Guard, false) it's not going to make sense?
TAPL Posted November 25, 2013 Posted November 25, 2013 Because when you spawn the bot there is a timer (200 ms) in the script "slothbot'" that set its attack to true, so you will have to use a time bigger than 200 ms for the function setBotAttackEnabled.
LiOneLMeSsIShoT Posted November 25, 2013 Author Posted November 25, 2013 Because when you spawn the bot there is a timer (200 ms) in the script "slothbot'" that set its attack to true, so you will have to use a time bigger than 200 ms for the function setBotAttackEnabled. Alright i understand about that..but i think the timer is not good idea for the script..so there's some way to remove the timer? if not then please tell me how to set the timer. and Thank you man
TAPL Posted November 25, 2013 Posted November 25, 2013 A single timer won't hurt, you just going do instead of this: exports.slothbot:setBotAttackEnabled(Guard, false) You will do this: setTimer(function() exports.slothbot:setBotAttackEnabled(Guard, false) end, 250, 1)
LiOneLMeSsIShoT Posted November 25, 2013 Author Posted November 25, 2013 A single timer won't hurt, you just going do instead of this: exports.slothbot:setBotAttackEnabled(Guard, false) You will do this: setTimer(function() exports.slothbot:setBotAttackEnabled(Guard, false) end, 250, 1) and could i disable the timer? or you have way to do this ...
TAPL Posted November 25, 2013 Posted November 25, 2013 No need, the timer will execute only one times and it will destroyed automatically.
LiOneLMeSsIShoT Posted November 25, 2013 Author Posted November 25, 2013 No need, the timer will execute only one times and it will destroyed automatically. Alright.. i did it and still attacks me. function guard (thePlayer) local x,y,z = getElementPosition (thePlayer) local Guard = exports ["slothbot"]:spawnBot (x,y,z, 0, 240, 0, 0, nil, 0, "follow", "following") setTimer(function() exports ["slothbot"]:setBotAttackEnabled(Guard, false) end, 9999999999999999, 1) end addCommandHandler ("guard", guard)
LiOneLMeSsIShoT Posted November 25, 2013 Author Posted November 25, 2013 9999999999999999? i think i have to put big number ? whatever i tried 9999999 and after fail tried 250 or even 1000...not works too....
TAPL Posted November 25, 2013 Posted November 25, 2013 You have wrong argument at spawnBot. function guard(thePlayer) local x,y,z = getElementPosition(thePlayer) Guard = exports ["slothbot"]:spawnBot(x,y,z, 0, 240, 0, 0, nil, 0, "following", thePlayer) setTimer(function() exports ["slothbot"]:setBotAttackEnabled(Guard, false) end, 250, 1) end addCommandHandler ("guard", guard)
LiOneLMeSsIShoT Posted November 25, 2013 Author Posted November 25, 2013 You have wrong argument at spawnBot. function guard(thePlayer) local x,y,z = getElementPosition(thePlayer) local Guard = exports ["slothbot"]:spawnBot(x,y,z, 0, 240, 0, 0, nil, 0, "following", thePlayer) setTimer(function() exports ["slothbot"]:setBotAttackEnabled(Guard, false) end, 250, 1) end addCommandHandler ("guard", guard) Alright tried it and works as the guard don't try to do anything on me... but there's some problem ..the bot takes long time to follow me...like not follows me when i move...the bot wait for long distance.. and then "jumps" follows me "move around me" "stop behind me" like the bot don't know what he should to do.
TAPL Posted November 25, 2013 Posted November 25, 2013 What you want the bot to do other than following you?
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