YouGroove Posted October 14, 2015 Share Posted October 14, 2015 I use that following modified script and i have a player with teamid = 1 , i'm curious why it doesn't work ? --find the player local entities = GetEntityNeighbors(self.entity,10000,true) local k,entity for k,entity in pairs(entities) do if entity.script~=nil and entity.script.teamid~=1 and entity.script.teamid==1 then self.debugteam = 1 if entity.script.health>0 then self.target = entity:FindChild("hitBoxPlayer") end end end When i read self.debugteam after this function it has value = 0 ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Einlander Posted October 14, 2015 Share Posted October 14, 2015 and entity.script.teamid~=1 and entity.script.teamid==1 This says if teamid is not 1 and is 1. Teamid can't be both. Try removing the teamid~=1 Quote Link to comment Share on other sites More sharing options...
thehankinator Posted October 14, 2015 Share Posted October 14, 2015 FYI you don't need to check for "entity.script ~= nil", you have the scriptOnly flag set to true in your GetEntityNeighbors call. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted October 14, 2015 Author Share Posted October 14, 2015 Thanks , coding is not my best area. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.