Mara$ Posted May 3, 2015 Share 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 Link to comment
WhoAmI Posted May 3, 2015 Share Posted May 3, 2015 change function(rotZ) to function(Player,cmd,rotZ) Link to comment
WhoAmI Posted May 3, 2015 Share Posted May 3, 2015 Show your current code and use [lua ] [ /lua] highlighting. Link to comment
Mara$ Posted May 3, 2015 Author Share 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) Link to comment
WhoAmI Posted May 3, 2015 Share 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) Link to comment
Mara$ Posted May 3, 2015 Author Share Posted May 3, 2015 Work http://imgur.com/6GpSMPo,8aWQxOL But didnt good rotate objects Link to comment
Mr.Solo Posted March 2, 2017 Share Posted March 2, 2017 Guys this isn't working for me ;'(! wtf did i do wrong! 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