local startX,startY,startZ = 0,0,0
local endX,endY,endZ = 0,0,0
local cameraStartHighed = 50
local progress = 0
local handled = false
local renderFunction
renderFunction = function()
setCameraMatrix(startX,startY,startZ-(cameraStartHighed*progress), endX,endY,endZ)
progress = progress+0.02
if progress >= 1 then
setCameraTarget(localPlayer)
progress = 0
removeEventHandler("onClientRender",root,renderFunction)
handled = false
end
end
local setCameraOnPlayerSpawn = function ()
local pX,pY,pZ = getElementPosition(localPlayer)
startX,startY,startZ, endX,endY,endZ= pX,pY,pZ+cameraStartHighed, pX,pY,pZ
setCameraMatrix(startX,startY,startZ, endX,endY,endZ)
if not handled then
addEventHandler("onClientRender",root,renderFunction)
handled = true
end
progress = 0
end
addEventHandler("onClientPlayerSpawn", root, setCameraOnPlayerSpawn)
you used the server side function in client side this is the fixed one
Bugs of this script every one see the camera matrix