-- The number of the basin to fall next local _basinNum = 1 --Trigger with a comment "basin" or "Basin" function onMessage(sender, name, message) -- content of the comment print(sender["name"].."「"..message.."」") --true if the comment includes either "basin" or "Basin" local basin = false if string.find(message,"basin") ~= nil then basin = true end if string.find(message,"Basin") ~= nil then basin = true end if basin == true then print("Drop a basin") local pos = Vector3.__new(0, 5, 0) BasinFire(pos) end end vci.message.On('comment', onMessage) -- Drop a basin at the position "pos" function BasinFire(pos) local basin = "T"..tostring(_basinNum) _basinNum = _basinNum + 1 if _basinNum > 16 then _basinNum = 1 end pos.y = pos.y + 0.5 * _basinNum vci.assets.GetTransform(basin).SetLocalPosition(pos) vci.assets.GetTransform(basin).SetLocalScale(Vector3.one) print("The position to drop a basin: "..tostring(pos)) end -- For debugging function onGrab(targe) if targe == "DebugSwitch" then print("Debug switch") local pos = Vector3.__new(0, 5, 0) BasinFire(pos) end end