Hello, Just a few days ago, I download download an community resource named 'Animals'.
You can find it here :- https://community.multitheftauto.com/in ... ls&id=6904
But soon after playing for a while with my friends, i found a bug. Which is,
When we change into an animal and then another player change into animal, We Automatically change back to human.
Noting that the script is bit old and is less likely to seen by the Author (I still post a bug report there).
In Meanwhile I tried to fixed it myself (As Denny199 suggested in Comments box) but no Success (As I am in Practice-Mode For Tables).
Here is the Full Script:-
local Cows = {}
local Fishes = {}
local Jellyfishes = {}
local Dolphins = {}
local Sharks = {}
local Turtles = {}
local Chickens = {}
local Humans = {}
local Saddles = {}
function makeCow(player)
local x, y, z = getElementPosition(Humans[player])
local rx, ry, rz = getElementRotation(Humans[player])
Cows[player] = createObject( 16442, x, y, z, rx, ry, rz, false)
-- Saddles[player] = createVehicle(441, x, y, z, rx, ry, rz)
setObjectScale(Cows[player], 0.4)
attachElements(Cows[player], Humans[player], 0, 0, -0.1, 0, 0, 90)
-- attachElements(Caddles[player], Cows[player], 0, 0, 0.4, 0, 0, 90)
cam = setCameraMatrix(Humans[player], x, y, z + 3 )
attachElements(cam, Cows[player])
setElementAlpha(Humans[player], 0)
setElementAlpha(Saddles[player], 0)
outputChatBox("You are now a Cow!", Humans[player], 0, 255, 0)
destroyElement(Chickens[player])
destroyElement(Dolphins[player])
destroyElement(Turtles[player])
destroyElement(Fishes[player])
destroyElement(Sharks[player])
destroyElement(Jellyfishes[player])
setCameraTarget(Humans[player], Humans[player])
setTimer(function() Humans[player] = nil end,5000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
end
addCommandHandler("cow", makeCow)
function makeFish(player)
local x, y, z = getElementPosition(Humans[player])
local rx, ry, rz = getElementRotation(Humans[player])
Fishes[player] = createObject( 1606, x, y, z, rx, ry, rz )
attachElements(Fishes[player], Humans[player])
setElementAlpha(Humans[player], 0)
outputChatBox("You are now a Fish!", Humans[player], 0, 255, 0)
setCameraTarget( Humans[player], Fishes[player] )
destroyElement(Saddles[player])
destroyElement(Cows[player])
destroyElement(Chickens[player])
destroyElement(Dolphins[player])
destroyElement(Turtles[player])
destroyElement(Sharks[player])
destroyElement(Jellyfishes[player])
setCameraTarget(Humans[player], Humans[player])
setTimer(function() Humans[player] = nil end,1000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
Saddles[player] = nil
end
addCommandHandler("fish", makeFish)
function makeJellyfish(player)
local x, y, z = getElementPosition(Humans[player])
local rx, ry, rz = getElementRotation(Humans[player])
Jellyfishes[player] = createObject( 1602, x, y, z, rx, ry, rz )
attachElements(Jellyfishes[player], Humans[player])
setElementAlpha(Humans[player], 0)
outputChatBox("You are now a Jellyfish!", Humans[player], 0, 255, 0)
setCameraTarget( Humans[player], Jellyfishes[player])
destroyElement(Cows[player])
destroyElement(Saddles[player])
destroyElement(Chickens[player])
destroyElement(Dolphins[player])
destroyElement(Turtles[player])
destroyElement(Sharks[player])
destroyElement(Fishes[player])
setCameraTarget(Humans[player], Humans[player])
setTimer(function() Humans[player] = nil end,1000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
Saddles[player] = nil
end
addCommandHandler("jellyfish", makeJellyfish)
function makeDolphin (player)
local x, y, z = getElementPosition(Humans[player])
local rx, ry, rz = getElementRotation(Humans[player])
Dolphins[player] = createObject( 1607, x, y, z, rx, ry, rz )
attachElements(Dolphins[player], Humans[player])
setElementAlpha(Humans[player], 0)
outputChatBox("You are now a Dolphin!", Humans[player], 0, 255, 0)
setCameraTarget( Humans[player], Dolphins[player] )
destroyElement(Cows[player])
destroyElement(Chickens[player])
destroyElement(Saddles[player])
destroyElement(Fishes[player])
destroyElement(Turtles[player])
destroyElement(Sharks[player])
destroyElement(Jellyfishes[player])
setCameraTarget(Humans[player], Humans[player])
setTimer(function() Humans[player] = nil end,1000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
Saddles[player] = nil
end
addCommandHandler("dolphins[player]", makeDolphin)
function makeShark (player)
local x, y, z = getElementPosition(Humans[player])
local rx, ry, rz = getElementRotation(Humans[player])
Sharks[player] = createObject( 1608, x, y, z, rx, ry, rz )
attachElements(Sharks[player], Humans[player])
setElementAlpha(Humans[player], 0)
outputChatBox("You are now a Shark!", Humans[player], 0, 255, 0)
setCameraTarget( Humans[player], Sharks[player])
destroyElement(Saddles[player])
destroyElement(Cows[player])
destroyElement(Chickens[player])
destroyElement(Dolphins[player])
destroyElement(Turtles[player])
destroyElement(Fishes[player])
destroyElement(Jellyfishes[player])
setCameraTarget(Humans[player], Humans[player])
setTimer(function() Humans[player] = nil end,1000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
Saddles[player] = nil
end
addCommandHandler("shark", makeShark)
function makeTurtle (player)
local x, y, z = getElementPosition(Humans[player])
local rx, ry, rz = getElementRotation(Humans[player])
Turtles[player] = createObject( 1609, x, y, z, rx, ry, rz )
attachElements(Turtles[player], Humans[player])
setElementAlpha(Humans[player], 0)
outputChatBox("You are now a Turtle!", Humans[player], 0, 255, 0)
setCameraTarget( player, Turtles[player] )
destroyElement(Cows[player])
destroyElement(Saddles[player])
destroyElement(Chickens[player])
destroyElement(Dolphins[player])
destroyElement(Fishes[player])
destroyElement(Sharks[player])
destroyElement(Jellyfishes[player])
setCameraTarget(Humans[player], Humans[player])
setTimer(function() Humans[player] = nil end,1000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
Saddles[player] = nil
end
addCommandHandler("turtle", makeTurtle)
function makeChicken (player)
local x, y, z = getElementPosition(Humans[player])
local rx, ry, rz = getElementRotation(Humans[player])
Chickens[player] = createObject( 16776, x, y, z, rx, ry, rz )
setObjectScale(Chickens[player], 0.19)
attachElements(Chickens[player], Humans[player], 0, -1.4, -1.6, 0, 0, 180)
setElementAlpha(Humans[player], 0)
destroyElement(Cows[player])
destroyElement(Saddles[player])
destroyElement(Dolphins[player])
destroyElement(Turtles[player])
destroyElement(Fishes[player])
destroyElement(Sharks[player])
destroyElement(Jellyfishes[player])
setCameraTarget(Humans[player], Humans[player])
outputChatBox("You are now a Chicken!", Humans[player], 0, 255, 0)
setTimer(function() Humans[player] = nil end,1000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
Saddles[player] = nil
end
addCommandHandler("chicken", makeChicken)
function makeHuman (player)
setElementAlpha(Humans[player], -1)
destroyElement(Cows[player])
destroyElement(Chickens[player])
destroyElement(Saddles[player])
destroyElement(Dolphins[player])
destroyElement(Turtles[player])
destroyElement(Fishes[player])
destroyElement(Sharks[player])
destroyElement(Jellyfishes[player])
setCameraTarget(Humans[player], Humans[player])
outputChatBox("You are now a Human!", Humans[player], 0, 255, 0)
setTimer(function() Humans[player] = nil end,1000,1)
Chickens[player] = nil
Dolphins[player] = nil
Turtles[player] = nil
Fishes[player] = nil
Sharks[player] = nil
Jellyfishes[player] = nil
Saddles[player] = nil
end
addCommandHandler("human", makeHuman)
Can You Guys Please Help Me ?