dewu Posted October 13, 2014 Share Posted October 13, 2014 Hi guys. I have that script: RestricLocation["location1"] = {-212.60000610352,1451.5,95.800003051758} RestricLocation["location2"] = {-277.20001220703,1509.5,75} function ResourceStart( ) setElementData (RestricLocation, "zombieProof", true) end I don't know why, it's not working and zombies can enter proof area ;/ Link to comment
Castillo Posted October 13, 2014 Share Posted October 13, 2014 You are trying to set a element data value to a table, that won't work, setElementData is used on events. Link to comment
dewu Posted October 13, 2014 Author Share Posted October 13, 2014 So if I do that.. RestricLocation["location1"] = {-212.60000610352,1451.5,95.800003051758} RestricLocation["location2"] = {-277.20001220703,1509.5,75} setElementData (RestricLocation, "zombieProof", true) it will work? @EDIT Okay, it works Thanks. Link to comment
Castillo Posted October 13, 2014 Share Posted October 13, 2014 That's the same thing... Link to comment
Mr_Moose Posted October 13, 2014 Share Posted October 13, 2014 You two misunderstood each others, the first function was never called which caused it to fail, and it does work to store tables as element data, it's not the most optimal solution but apparently it works. Link to comment
Castillo Posted October 13, 2014 Share Posted October 13, 2014 I'm not sure if you read the code correctly: he's trying to SET element data to a TABLE, not store a TABLE into element data. Link to comment
Saml1er Posted October 14, 2014 Share Posted October 14, 2014 local sf = createRadarArea (...) setElementData (sf, "zombieProof", true) Zombie proof works with radar ^^ Link to comment
Mr_Moose Posted October 14, 2014 Share Posted October 14, 2014 Looks like I didn't read it correctly then, that also explains the illusion of how the script seems to work @dewu, tables are also elements, so you may be able to assign a value to them, however finding that value when it's needed would be more complicated, since you still have to use a solution like what Saml1er wrote above. 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