Captain Cody Posted August 3, 2014 Share Posted August 3, 2014 How would I make it so I can glue the dogs onto cars by command function Spawndoggy (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setElementData(source, "isDogSpawned", true) dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) end addCommandHandler("spawndog", Spawndoggy) function dogA(source) if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else outputChatBox("Your dog will start attacking now!", source) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog, true ) end end addCommandHandler("Dogattack", dogA) I have that sceript And glue2 Link to comment
Captain Cody Posted August 3, 2014 Author Share Posted August 3, 2014 And How can I make them follow certain people Link to comment
Anubhav Posted August 3, 2014 Share Posted August 3, 2014 function Spawndoggy (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setElementData(source, "isDogSpawned", true) dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) follow = exports.slothbot:setBotFollow(dog, ) -- someone you want to follow. I am leaving it empty! end addCommandHandler("spawndog", Spawndoggy) function dogA(source) if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else outputChatBox("Your dog will start attacking now!", source) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog, true ) end end addCommandHandler("Dogattack", dogA) function dogGlue(source) if not isPedInVehicle ( source ) then outputChatBox("Get a vehicle first.", source) return end if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else attachElements(source, dog) end end addCommandHandler('Gluedog', dogGlue) Link to comment
Captain Cody Posted August 3, 2014 Author Share Posted August 3, 2014 Then How can I make it so on /dogwarp it warps the dog to me and pauses it untill I glue it to vehicle Link to comment
Anubhav Posted August 3, 2014 Share Posted August 3, 2014 function Spawndoggy (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setElementData(source, "isDogSpawned", true) dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) follow = exports.slothbot:setBotFollow(dog, ) -- someone you want to follow. I am leaving it empty! end addCommandHandler("spawndog", Spawndoggy) function dogA(source) if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else outputChatBox("Your dog will start attacking now!", source) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog, true ) end end addCommandHandler("Dogattack", dogA) function dopWarp(source) if isPedInVehicle( source ) then local vehi = getPedOccupiedVehicle( source ) local x,y,z = getElementPosition( source ) setElementData(dog, "canBeGlued", true) setElementFrozen(dog, true) setElementPosition(dog, x+2,y+5,z) outputChatBox("Please get into a vehicle and use /Gluedog", source) else local x,y,z = getElementPosition(source) setElementPosition(dog, x, y, z ) setElementData(dog, "canBeGlued", true) setElementFrozen(dog, true) outputChatBox("Please get into a vehicle and use /Gluedog", source) end end addCommandHandler("dogwarp", dopWarp) function dogGlue(source) if not getElementData(dog, "canBeGlued") then outputChatBox("Please use /dogwarp first!", source) return end if not isPedInVehicle ( source ) then outputChatBox("Get a vehicle first.", source) return end if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else attachElements(source, dog) removeElementData( dog, "canBeGlued" ) end end addCommandHandler('Gluedog', dogGlue) 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