Mara$ Posted May 3, 2015 Posted May 3, 2015 massRotateObjects = function(rotZ) local elementTypes = {"object", "vehicle", "pickup", "marker", "racepickup", "spawnpoint", "checkpoint", "blip", "controlpoint", "track"} local rotated = 0 for _,elemType in ipairs(elementTypes) do for i,elem in ipairs(getElementsByType(elemType)) do local z = getElementPosition(elem) setElementPosition(elem, 90 + rotZ) local z = getElementPosition(elem) setElementData(elem, "rotZ", 90) rotated = rotated + 1 end end end addCommandHandler("rotz", massRotateObjects) [2015-05-03 13:58:54] ERROR: netools\rotz.lua:7: attempt to perform arithmetic on local 'rotZ' (a userdata value) script to rotate any object by 90 degrees + actual rotZ
WhoAmI Posted May 3, 2015 Posted May 3, 2015 Show your current code and use [lua ] [ /lua] highlighting.
Mara$ Posted May 3, 2015 Author Posted May 3, 2015 massRotateObjects = function(player,cmd,rotZ) local elementTypes = {"object", "vehicle", "pickup", "marker", "racepickup", "spawnpoint", "checkpoint", "blip", "controlpoint", "track"} local rotated = 0 for _,elemType in ipairs(elementTypes) do for i,elem in ipairs(getElementsByType(elemType)) do local z = getElementPosition(elem) setElementPosition(elem, 90 + rotZ) local z = getElementPosition(elem) setElementData(elem, "rotZ", 90) rotated = rotated + 1 end end end addCommandHandler("rotz", massRotateObjects)
WhoAmI Posted May 3, 2015 Posted May 3, 2015 massRotateObjects = function(player,cmd,rotZ) local elementTypes = {"object", "vehicle", "pickup", "marker", "racepickup", "spawnpoint", "checkpoint", "blip", "controlpoint", "track"} local rotated = 0 for _,elemType in ipairs(elementTypes) do for i,elem in ipairs(getElementsByType(elemType)) do local rx,ry,rz = getElementRotation(elem) setElementRotation(elem, rx, ry, rz + rotZ) setElementData(elem, "rotZ", rz + rotZ) rotated = rotated + 1 end end end addCommandHandler("rotz", massRotateObjects)
Mara$ Posted May 3, 2015 Author Posted May 3, 2015 Work http://imgur.com/6GpSMPo,8aWQxOL But didnt good rotate objects
Mr.Solo Posted March 2, 2017 Posted March 2, 2017 Guys this isn't working for me ;'(! wtf did i do wrong!
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