Is it possible to define a function, such as “setTeam”, so that you could write" character:setTeam(bad)" [import]uid: 116264 topic_id: 27532 reply_id: 327532[/import]
One way of doing it :
[code]
local function create()
local object = display.newRect(100, 100, 100, 100)
function object:setTeam(team)
self.team = team
print(self.team)
end
return object
end
local char = create()
char:setTeam(“Dallas”)
[/code] [import]uid: 84637 topic_id: 27532 reply_id: 112200[/import]