Hello! I am brand new to LUA and the whole coding scene in Garry's Mod, and I need some help.
I need to make 1 team have a 3rd person camera perspective, and the other team have a 1st person perspective. I have no idea where to put anything, or how to do it.
Can someone help me?
Thanks!
[url]http://wiki.garrysmod.com/page/GM/CalcView[/url]
This has thirdperson code on it and to make it only affect 1 team you check the LocalPlayer's team is the team you want to have thirdperson using an if statement. The first argument of CalcView is the LocalPlayer so you don't need to call LocalPlayer().
How would I go about adding the team function?
[CODE] if ply:Team() == 1 then
-- Thirdperson calcview
end
[/CODE]
One more question, where is this all supposed to go? I'm currently trying to put it into the [B]cl_init.lua[/B] part, but it only works without the team expression.
(and by the way, thank you guys so much for helping me! :happy:)
/lua/autorun/client/originalname.lua
Is there any way to merge it into a gamemode?
yes, they already told you
I'm still super confused
[editline]24th April 2017[/editline]
It gives me an error, either in the "originalname.lua" or the "cl_init.lua".
Code:
[IMG]http://imgur.com/MuSR7pD.png[/IMG]
Error in console
[IMG]http://i.imgur.com/UD2lHx2.png[/IMG]
I recommend you to read about how programing works, you can star with lua website, it shows the syntax and how to define functions and conditionals
First at all, you are making a condition and then a function, conditions goes inside functions, as you dont have Player defined nowhere, thats why you get that error, you have see where do you have to put the condition and how hooks works
i love you all
Thank you everyone!
Sorry, you need to Log In to post a reply to this thread.