stefutz101 Posted September 28, 2015 Share Posted September 28, 2015 Hi i have a question . This script works fine when i'm in team "Admin" when i leave the team in debugscript 3 appear warnings , a lot o warnings . It spam with warnings . I have warning at "local teamName = getTeamName(playerTeam)" . Help please . Thanks in advance! local localPlayer = getLocalPlayer() local function canFly() local playerTeam = getPlayerTeam(localPlayer) local teamName = getTeamName(playerTeam) if teamName == "Admin" then return getTeamName(getPlayerTeam(localPlayer)) == "Admin" else return end end Link to comment
t3wz Posted September 28, 2015 Share Posted September 28, 2015 You have to check if getPlayerTeam don't returned false, after this you get the team name. Link to comment
stefutz101 Posted September 28, 2015 Author Share Posted September 28, 2015 local localPlayer = getLocalPlayer() local function canFly() local playerTeam = getPlayerTeam(localPlayer) if playerTeam then local teamName = getTeamName(playerTeam) if teamName == "Admin" then return getTeamName(getPlayerTeam(localPlayer)) == "Admin" else return end end end This should work ? Link to comment
Mega9 Posted September 28, 2015 Share Posted September 28, 2015 Just a tip, you don't need to define 'localPlayer' it is already hardcoded, so just using localPlayer will do. 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