Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Lua code. See documentation: http://berserk-games.com/knowledgebase/scripting/ --]]
- guid = {}
- guid.cnterA = "faedd9"
- guid.cnterB = "460f8a"
- guid.cnterC = "ee57a7"
- obj = {}
- obj.cnterA = nil
- obj.cnterB = nil
- obj.cnterC = nil
- function onload()
- obj.cnterA = getObjectFromGUID(guid.cnterA)
- obj.cnterB = getObjectFromGUID(guid.cnterB)
- obj.cnterC = getObjectFromGUID(guid.cnterC)
- startLuaCoroutine(Global, "SumCoroutine")
- end
- function SumCoroutine()
- while true do
- obj.cnterC.setValue(obj.cnterA.getValue() + obj.cnterB.getValue())
- YieldForSeconds(1)
- end
- return 1
- end
- function YieldForSeconds(_seconds)
- t = os.clock()
- while os.clock() - t < _seconds do
- coroutine.yield(0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement