Mathias Lui Posted December 2, 2015 Share Posted December 2, 2015 Hello Community, I've got a problem with my script. When I try to run it it won't work. Nothing of it. I'm a newbie in scripting. Here's the xml file: "Mathias Lui" type="script" /> and the lua file (script.lua) cam1 = createObject(1886,1592.1999511719,-1370.0999755859,34.299999237061, 10, 0, 0) function gotoCam1() setCameraMatrix(source, 1592.1999511719,-1370.0999755859,34.299999237061, 1593.0999755859, -1397.3000488281, 27.799999237061, roll = 0, fov = 100) end addCommandHandler("cctv", gotoCam1) function gotoPlayer() setCameraTarget(source) end addCommandHandler("lcctv", gotoPlayer) I also tried this: cam1 = createObject(1886,1592.1999511719,-1370.0999755859,34.299999237061, 10, 0, 0) function gotoCam1() setCameraMatrix(localPlayer, 1592.1999511719,-1370.0999755859,34.299999237061, 1593.0999755859, -1397.3000488281, 27.799999237061, roll = 0, fov = 100) end addCommandHandler("cctv 1 pw", gotoCam1) function gotoPlayer() setCameraTarget(localPlayer) end addCommandHandler("lcctv", gotoPlayer) Hope you can help me! Mathias Lui Link to comment
iPrestege Posted December 2, 2015 Share Posted December 2, 2015 -- ClientSide local cam1 = createObject ( 1886,1592.1999511719,-1370.0999755859,34.299999237061, 10, 0, 0 ) function gotoCam1( ) setCameraMatrix ( 1592.1999511719,-1370.0999755859,34.299999237061, 1593.0999755859, -1397.3000488281, 27.799999237061,0,100 ) end addCommandHandler ( '1cctv', gotoCam1 ) function gotoPlayer ( ) setCameraTarget ( localPlayer ) end addCommandHandler ( '2cctv', gotoPlayer ) P.S : I changed the command both of them. Link to comment
Mathias Lui Posted December 2, 2015 Author Share Posted December 2, 2015 @Mr.pres[T]ege What did you do different? It works now (thanks for that) but what did you change? Was the command i used already in use? Or what was the error? I mean, the createObject didn't work as well but now it works. Link to comment
iPrestege Posted December 2, 2015 Share Posted December 2, 2015 @Mr.pres[T]ege What did you do different? It works now (thanks for that) but what did you change? Was the command i used already in use? Or what was the error? I mean, the createObject didn't work as well but now it works. The problem was in line 3 next time you should use the wiki bro actually in the client side there's no player variable also there's no need to use roll and fov to defined it because they are already defined . Link to comment
Mathias Lui Posted December 2, 2015 Author Share Posted December 2, 2015 The problem was in line 3 next time you should use the wiki bro actually in the client side there's no player variable also there's no need to use roll and fov to defined it because they are already defined . So there's no way to change the fov for the camera? Link to comment
iPrestege Posted December 2, 2015 Share Posted December 2, 2015 No you can change the fov and the roll just use the last two arguments and use numbers without roll = xx and fav = xx just numbers Link to comment
Mathias Lui Posted December 2, 2015 Author Share Posted December 2, 2015 Oh ok thanks I'm a beginner, so there's still much to learn... Link to comment
iPrestege Posted December 2, 2015 Share Posted December 2, 2015 Good luck and You're welcome . 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