Mathias Lui Posted December 2, 2015 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
iPrestege Posted December 2, 2015 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.
Mathias Lui Posted December 2, 2015 Author 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.
iPrestege Posted December 2, 2015 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 .
Mathias Lui Posted December 2, 2015 Author 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?
iPrestege Posted December 2, 2015 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
Mathias Lui Posted December 2, 2015 Author Posted December 2, 2015 Oh ok thanks I'm a beginner, so there's still much to learn...
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