v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
23
assets/devel/scripts/chattest.lua
Normal file
23
assets/devel/scripts/chattest.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
function init()
|
||||
object.setInteractive(true)
|
||||
self.timer = math.random(0, 2)
|
||||
end
|
||||
|
||||
function onInteraction(args)
|
||||
local chatOptions = config.getParameter("portraitChatOptions", {})
|
||||
if #chatOptions > 0 then
|
||||
local chatChoice = chatOptions[math.random(1, #chatOptions)]
|
||||
object.sayPortrait(chatChoice[1], chatChoice[2])
|
||||
end
|
||||
end
|
||||
|
||||
function update(dt)
|
||||
self.timer = self.timer - dt
|
||||
if self.timer <= 0 then
|
||||
self.timer = 6
|
||||
local chatOptions = config.getParameter("chatOptions", {})
|
||||
if #chatOptions > 0 then
|
||||
object.say(chatOptions[math.random(1, #chatOptions)])
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue